mirror of
https://github.com/samsonjs/strftime.git
synced 2026-04-27 14:57:37 +00:00
Update strftime.js
Fixed semantics changing equalities
This commit is contained in:
parent
376c9cd550
commit
71a640452e
1 changed files with 5 additions and 5 deletions
10
strftime.js
10
strftime.js
|
|
@ -15,7 +15,7 @@
|
||||||
var namespace;
|
var namespace;
|
||||||
|
|
||||||
// CommonJS / Node module
|
// CommonJS / Node module
|
||||||
if (typeof module !== 'undefined') {
|
if (typeof module != 'undefined') {
|
||||||
namespace = module.exports = strftime;
|
namespace = module.exports = strftime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
// locale is optional
|
// locale is optional
|
||||||
namespace.strftimeTZ = strftime.strftimeTZ = strftimeTZ;
|
namespace.strftimeTZ = strftime.strftimeTZ = strftimeTZ;
|
||||||
function strftimeTZ(fmt, d, locale, timezone) {
|
function strftimeTZ(fmt, d, locale, timezone) {
|
||||||
if ((typeof locale === 'number' || typeof locale === 'string') && timezone === null) {
|
if ((typeof locale === 'number' || typeof locale === 'string') && timezone == null) {
|
||||||
timezone = locale;
|
timezone = locale;
|
||||||
locale = undefined;
|
locale = undefined;
|
||||||
}
|
}
|
||||||
|
|
@ -185,13 +185,13 @@
|
||||||
return pad(day, 3);
|
return pad(day, 3);
|
||||||
|
|
||||||
// ' 0'
|
// ' 0'
|
||||||
case 'k': return pad(d.getHours(), padding === null ? ' ' : padding);
|
case 'k': return pad(d.getHours(), padding == null ? ' ' : padding);
|
||||||
|
|
||||||
// '000'
|
// '000'
|
||||||
case 'L': return pad(Math.floor(timestamp % 1000), 3);
|
case 'L': return pad(Math.floor(timestamp % 1000), 3);
|
||||||
|
|
||||||
// '12'
|
// '12'
|
||||||
case 'l': return pad(hours12(d), padding === null ? ' ' : padding);
|
case 'l': return pad(hours12(d), padding == null ? ' ' : padding);
|
||||||
|
|
||||||
// '00'
|
// '00'
|
||||||
case 'M': return pad(d.getMinutes(), padding);
|
case 'M': return pad(d.getMinutes(), padding);
|
||||||
|
|
@ -306,7 +306,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Defaults handle pad(n) and pad(n, <padding>)
|
// Defaults handle pad(n) and pad(n, <padding>)
|
||||||
if (padding === null) {
|
if (padding == null) {
|
||||||
padding = '0';
|
padding = '0';
|
||||||
}
|
}
|
||||||
length = length || 2;
|
length = length || 2;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue