Skip to content

Commit

Permalink
Adjusted fake data again
Browse files Browse the repository at this point in the history
to strip seconds when we produce only HH:mm supporting input fields
  • Loading branch information
OmarHawk committed Jan 16, 2025
1 parent 9cb202a commit f5bc909
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion generators/base-application/support/prepare-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ function generateFakeDataForField(
if (field.fieldType === LOCAL_DATE) {
data = originalData.split('T')[0];
} else if (field.fieldType === LOCAL_TIME) {
data = originalData.split('T')[1].split('.')[0];
// time without seconds by default
const timeWithoutMilliseconds = originalData.split('T')[1].split('.')[0];
// default time input fields are set to support HH:mm only. Would produce validation errors otherwise.
data = timeWithoutMilliseconds.substring(0, timeWithoutMilliseconds.lastIndexOf(':'));
} else if (type === 'json-serializable') {
data = date;
} else {
Expand Down

0 comments on commit f5bc909

Please sign in to comment.