diff --git a/packages/lib/models/Setting.ts b/packages/lib/models/Setting.ts index d5044945d..a68b44dff 100644 --- a/packages/lib/models/Setting.ts +++ b/packages/lib/models/Setting.ts @@ -217,6 +217,7 @@ class Setting extends BaseModel { public static TIME_FORMAT_1 = 'HH:mm'; public static TIME_FORMAT_2 = 'h:mm A'; + public static TIME_FORMAT_3 = 'HH.mm'; public static SHOULD_REENCRYPT_NO = 0; // Data doesn't need to be re-encrypted public static SHOULD_REENCRYPT_YES = 1; // Data should be re-encrypted @@ -741,6 +742,7 @@ class Setting extends BaseModel { const now = new Date('2017-01-30T20:30:00').getTime(); options[Setting.TIME_FORMAT_1] = time.formatMsToLocal(now, Setting.TIME_FORMAT_1); options[Setting.TIME_FORMAT_2] = time.formatMsToLocal(now, Setting.TIME_FORMAT_2); + options[Setting.TIME_FORMAT_3] = time.formatMsToLocal(now, Setting.TIME_FORMAT_3); return options; }, storage: SettingStorage.File, diff --git a/packages/lib/models/dateTimeFormats.test.ts b/packages/lib/models/dateTimeFormats.test.ts index c9802a46a..f89829d26 100644 --- a/packages/lib/models/dateTimeFormats.test.ts +++ b/packages/lib/models/dateTimeFormats.test.ts @@ -39,10 +39,11 @@ describe('dateFormats', function() { // TIME_FORMAT_1 = 'HH:mm'; // TIME_FORMAT_2 = 'h:mm A'; + // TIME_FORMAT_3 = 'HH.mm'; expect(time.formatMsToLocal(now, Setting.TIME_FORMAT_1)).toBe('20:30'); expect(time.formatMsToLocal(now, Setting.TIME_FORMAT_2)).toBe('8:30 PM'); - + expect(time.formatMsToLocal(now, Setting.TIME_FORMAT_3)).toBe('20.30'); })); });