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

Commit 03dae07

Browse files
committed
feat: map all dates from server in HTTP services
Fix #482
1 parent aa9ff52 commit 03dae07

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

generators/entity-client/templates/vue/src/main/webapp/app/entities/entity-update.component.ts.ejs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,16 @@ export default class <%= entityAngularName %>Update extends <% if (fieldsContain
179179
if ([ 'Instant', 'ZonedDateTime' ].includes(fieldType) && !dateFunctionIncluded) {
180180
dateFunctionIncluded = true;
181181
_%>
182-
public convertDateTimeFromServer(date: Date): string {
182+
public convertDateTimeFromServer(date: Date): Date {
183183
if (date) {
184-
return format(date, DATE_TIME_LONG_FORMAT);
184+
return date;
185+
}
186+
return null;
187+
}
188+
189+
public convertDateTimeArrayFromServer(dates: Date[]): Date[] {
190+
if (dates) {
191+
return dates;
185192
}
186193
return null;
187194
}

generators/entity-client/templates/vue/src/test/javascript/spec/app/entities/entity-management-update.component.spec.ts.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ describe('Component Tests', () => {
127127
const convertedDate = comp.convertDateTimeFromServer(date);
128128
129129
// THEN
130-
expect(convertedDate).toEqual(format(date, DATE_TIME_LONG_FORMAT));
130+
expect(convertedDate).toEqual(date));
131131
});
132132
133133
it('Should not convert date if date is not present', () => {

0 commit comments

Comments
 (0)