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