Skip to content

Commit

Permalink
solve the apply date for links in harvest section (#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
hichri-louay authored Nov 17, 2023
1 parent 9742dae commit 2f93e63
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ <h3 class="post-title">{{ video?.title }}</h3>
{{ 'appliedOn' | translate }}
<span>{{ prom.applyDate | date: 'dd/MM/yyyy' }}</span>
{{ 'at' | translate }}
<span>{{
(prom.applyDate | date: 'HH') + 'H' + (prom.applyDate | date: 'HH')
}}</span>
<span>
{{getApplyTime(prom.applyDate)}}
</span>

</p>

<div class="participation-link-wrapper" *ngIf="postLink$ | async as link">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ export class RecoverGainsComponent implements OnInit {
this.isDestroyedSubject.complete();
}

getApplyTime(applyDate: any) {
const timestamp: number = new Date(applyDate).getTime();
const dateObject: Date = new Date(timestamp);
let formattedTime: string = dateObject.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', hour12: false });
return formattedTime
}

goToCampaign() {
// this.router.navigate([".."]);
this.router.navigate(['/home/campaign', this.campaignId], {
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@
"Crypto_Highlights_Week_#29": "Crypto Highlights Week #29",
"Crypto_Highlights_Week_#28": "Crypto Highlights Week #28",
"Our_tools": "Our tools",
"appliedOn": "APPLIED ON ",
"Satt_wallet": "Satt wallet",
"Our_Dex": "Our Dex, 3xchange.io",
"don't_show_again": "Mute future reminders",
Expand Down

0 comments on commit 2f93e63

Please sign in to comment.