File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 204
204
var p = Math.max(0,Math.min(dp,dp - Math.floor(Math.log(n)/Math.log(10))));
205
205
return n.toFixed(p);
206
206
}
207
- var is12;
207
+ var _is12Hours;
208
+ function is12Hours() {
209
+ if (_is12Hours === undefined) _is12Hours = ${ isLocal ? "false" : `(require('Storage').readJSON('setting.json', 1) || {})["12hour"]` } ;
210
+ return _is12Hours;
211
+ }
208
212
function getHours(d) {
209
213
var h = d.getHours();
210
- if (is12 === undefined) is12 = ${ isLocal ? "false" : `(require('Storage').readJSON('setting.json', 1) || {})["12hour"]` } ;
211
- if (!is12) return ('0' + h).slice(-2);
214
+ if (!is12Hours()) return ('0' + h).slice(-2);
212
215
return ((h % 12 == 0) ? 12 : h % 12).toString();
213
216
}
214
217
exports = {
237
240
translate: s => ${ locale . trans ?`{var t=${ js ( locale . trans ) } ;s=''+s;return t[s]||t[s.toLowerCase()]||s;}` :`s` } ,
238
241
date: (d,short) => short ? \`${ dateS } \` : \`${ dateN } \`,
239
242
time: (d,short) => short ? \`${ timeS } \` : \`${ timeN } \`,
240
- meridian: d => d.getHours() < 12 ? ${ js ( locale . ampm [ 0 ] ) } :${ js ( locale . ampm [ 1 ] ) } ,
243
+ meridian: d => is12Hours() ? d.getHours() < 12 ? ${ js ( locale . ampm [ 0 ] ) } :${ js ( locale . ampm [ 1 ] ) } : "" ,
241
244
};
242
245
` . trim ( )
243
246
} ;
You can’t perform that action at this time.
0 commit comments