mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-23 18:53:36 +02:00
All: Add date format YYYY/MM/DD (#5759)
This commit is contained in:
parent
42c32c13e7
commit
8bebf99950
@ -213,6 +213,7 @@ class Setting extends BaseModel {
|
||||
public static DATE_FORMAT_6 = 'DD.MM.YYYY';
|
||||
public static DATE_FORMAT_7 = 'YYYY.MM.DD';
|
||||
public static DATE_FORMAT_8 = 'YYMMDD';
|
||||
public static DATE_FORMAT_9 = 'YYYY/MM/DD';
|
||||
|
||||
public static TIME_FORMAT_1 = 'HH:mm';
|
||||
public static TIME_FORMAT_2 = 'h:mm A';
|
||||
@ -697,6 +698,7 @@ class Setting extends BaseModel {
|
||||
options[Setting.DATE_FORMAT_6] = time.formatMsToLocal(now, Setting.DATE_FORMAT_6);
|
||||
options[Setting.DATE_FORMAT_7] = time.formatMsToLocal(now, Setting.DATE_FORMAT_7);
|
||||
options[Setting.DATE_FORMAT_8] = time.formatMsToLocal(now, Setting.DATE_FORMAT_8);
|
||||
options[Setting.DATE_FORMAT_9] = time.formatMsToLocal(now, Setting.DATE_FORMAT_9);
|
||||
return options;
|
||||
},
|
||||
storage: SettingStorage.File,
|
||||
|
@ -19,6 +19,7 @@ describe('dateFormats', function() {
|
||||
// DATE_FORMAT_6 = 'DD.MM.YYYY';
|
||||
// DATE_FORMAT_7 = 'YYYY.MM.DD';
|
||||
// DATE_FORMAT_8 = 'YYMMDD';
|
||||
// DATE_FORMAT_9 = 'YYYY/MM/DD';
|
||||
|
||||
expect(time.formatMsToLocal(now, Setting.DATE_FORMAT_1)).toBe('30/01/2017');
|
||||
expect(time.formatMsToLocal(now, Setting.DATE_FORMAT_2)).toBe('30/01/17');
|
||||
@ -28,6 +29,7 @@ describe('dateFormats', function() {
|
||||
expect(time.formatMsToLocal(now, Setting.DATE_FORMAT_6)).toBe('30.01.2017');
|
||||
expect(time.formatMsToLocal(now, Setting.DATE_FORMAT_7)).toBe('2017.01.30');
|
||||
expect(time.formatMsToLocal(now, Setting.DATE_FORMAT_8)).toBe('170130');
|
||||
expect(time.formatMsToLocal(now, Setting.DATE_FORMAT_9)).toBe('2017/01/30');
|
||||
|
||||
}));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user