Skip to content
This repository has been archived by the owner on Mar 21, 2021. It is now read-only.

Commit

Permalink
feat: map all dates from server in HTTP services
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Jun 22, 2020
1 parent aa9ff52 commit d56eab2
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,17 @@ export default class <%= entityAngularName %>Update extends <% if (fieldsContain
return null;
}

public convertDateTimeFromServer(dates: Date[]): string[] {
if (dates) {
let convertedDates = [];
dates.forEach(date => {
convertedDates.push(format(date, DATE_TIME_LONG_FORMAT));
});
return convertedDates;
}
return null;
}

public updateInstantField(field, event) {
if (event.target.value) {
this.<%= entityInstance %>[field] = parse(event.target.value, DATE_TIME_LONG_FORMAT, new Date());
Expand Down

0 comments on commit d56eab2

Please sign in to comment.