Skip to content

Commit

Permalink
Add new method to format date in day and short month #49
Browse files Browse the repository at this point in the history
  • Loading branch information
rserra91 committed Dec 2, 2020
1 parent a3258de commit 03358bb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions projects/systelab-translate/src/lib/date-util/date-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ export class DateUtil {
return format(date, 'MMMM, yyyy', {locale: this.convertSystelabLocaleToDateFnsLocale(this.locale)});
}

public formatDateAndShortMonth(date: Date) {
if (!date) {
return undefined;
}
return format(date, 'd MMM', {locale: this.convertSystelabLocaleToDateFnsLocale(this.locale)});
}

public getDateFrom(date: Date) {
let d: Date = setHours(date, 0);
d = setMinutes(d, 0);
Expand Down

0 comments on commit 03358bb

Please sign in to comment.