mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-30 10:36:35 +02:00
All: Add additional time format HH.mm (#6086)
This commit is contained in:
parent
e3c9bcbec6
commit
288ae1b463
@ -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,
|
||||
|
@ -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');
|
||||
}));
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user