Skip to content

Commit c739a9c

Browse files
authored
Merge pull request #225 from ilri/daterange-fix
Daterange fix
2 parents b3548fc + 31d6ee7 commit c739a9c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ backend/.env
44

55
# Ignore rtx version files
66
.tool-versions
7+
.idea/
8+
backend/data/templates/migrated

frontend/src/app/app.module.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,16 @@ export const ISO_8601_date_format = {
3434
class PickDateAdapter extends NativeDateAdapter {
3535
format(date: Date, displayFormat: string): string {
3636
if (displayFormat === 'input') {
37-
return formatDate(date, 'YYYY-MM-dd', this.locale);
37+
const year = date.getFullYear();
38+
const month = (date.getMonth() + 1).toString();
39+
const day = date.getDate().toString();
40+
return (
41+
year +
42+
'-' +
43+
(month.length === 1 ? `0${month}` : month) +
44+
'-' +
45+
(day.length === 1 ? `0${day}` : day)
46+
);
3847
} else {
3948
return date.toDateString();
4049
}

0 commit comments

Comments
 (0)