mirror of
https://github.com/samsonjs/strftime.git
synced 2026-04-05 10:45:47 +00:00
Compare commits
17 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f2d5290d28 | |||
| 8db2211a2f | |||
| 774e3ce102 | |||
| e61895af6c | |||
| 8a335897ae | |||
| db1c066f13 | |||
| 6cf7d59a46 | |||
| 53e26ba77d | |||
| a0a62db076 | |||
| 52753479c8 | |||
| 67c02b5352 | |||
|
|
b50d512dee | ||
|
|
6157e8a650 | ||
|
|
51a6ade03d | ||
| 93aaf1eac6 | |||
| 12088240fc | |||
| 3af75444e1 |
10 changed files with 120 additions and 66 deletions
16
Changelog.md
16
Changelog.md
|
|
@ -1,3 +1,19 @@
|
||||||
|
v0.10.3 on 2024-06-11
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
- Stop using `let` to avoid breaking backwards compatibility with ES5. Thanks to [Maximilian Herold](https://github.com/mherold) for the report #87
|
||||||
|
|
||||||
|
- Drop '份' suffix from Chinese month names. Thanks to [@mogando668](https://github.com/mogando668) for the report #88
|
||||||
|
|
||||||
|
v0.10.2 on 2023-05-24
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
- Fix test case for %c in current versions of node.js
|
||||||
|
|
||||||
|
- Fix %-y so it omits the leading zero
|
||||||
|
|
||||||
|
Thanks to [Aryan Arora](https://github.com/aryan-debug) for both fixes!
|
||||||
|
|
||||||
v0.10.1 on 2021-12-12
|
v0.10.1 on 2021-12-12
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
|
|
||||||
2
Makefile
2
Makefile
|
|
@ -2,7 +2,7 @@ minify: real-minify test-minified
|
||||||
|
|
||||||
real-minify: strftime.js
|
real-minify: strftime.js
|
||||||
rm -f strftime-min.js
|
rm -f strftime-min.js
|
||||||
closure <strftime.js >|strftime-min.js
|
closure-compiler <strftime.js >|strftime-min.js
|
||||||
|
|
||||||
test:
|
test:
|
||||||
TZ=America/Vancouver node test.js
|
TZ=America/Vancouver node test.js
|
||||||
|
|
|
||||||
18
Readme.md
18
Readme.md
|
|
@ -3,7 +3,10 @@ strftime
|
||||||
|
|
||||||
strftime for JavaScript. Works in (at least) node.js and browsers. Supports localization and timezones. Most standard specifiers from C are supported as well as some other extensions from Ruby.
|
strftime for JavaScript. Works in (at least) node.js and browsers. Supports localization and timezones. Most standard specifiers from C are supported as well as some other extensions from Ruby.
|
||||||
|
|
||||||
[](https://www.npmjs.com/package/strftime) [](https://nodejs.org) [](https://sjs.mit-license.org)
|
[](https://www.npmjs.com/package/strftime)
|
||||||
|
[](https://nodejs.org)
|
||||||
|
[](https://sjs.mit-license.org)
|
||||||
|
[](https://0dependencies.dev)
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
============
|
============
|
||||||
|
|
@ -46,6 +49,7 @@ If you want to localize it:
|
||||||
```JavaScript
|
```JavaScript
|
||||||
var strftime = require('strftime') // not required in browsers
|
var strftime = require('strftime') // not required in browsers
|
||||||
var it_IT = {
|
var it_IT = {
|
||||||
|
identifier: 'it-IT',
|
||||||
days: ['domenica', 'lunedi', 'martedi', 'mercoledi', 'giovedi', 'venerdi', 'sabato'],
|
days: ['domenica', 'lunedi', 'martedi', 'mercoledi', 'giovedi', 'venerdi', 'sabato'],
|
||||||
shortDays: ['dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab'],
|
shortDays: ['dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab'],
|
||||||
months: ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'],
|
months: ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'],
|
||||||
|
|
@ -147,7 +151,7 @@ e.g. `%q` becomes `q`. Use `%%` to get a literal `%` sign.
|
||||||
- X: equivalent to `%T` or `%r` in en_US (based on locale)
|
- X: equivalent to `%T` or `%r` in en_US (based on locale)
|
||||||
- x: equivalent to `%D` in en_US (based on locale)
|
- x: equivalent to `%D` in en_US (based on locale)
|
||||||
- Y: the year with the century
|
- Y: the year with the century
|
||||||
- y: the year without the century (00-99)
|
- y: the year without the century, padded to 2 digits (00-99)
|
||||||
- Z: the time zone name, replaced with an empty string if it is not found
|
- Z: the time zone name, replaced with an empty string if it is not found
|
||||||
- z: the time zone offset from UTC, with a leading plus sign for UTC and zones east
|
- z: the time zone offset from UTC, with a leading plus sign for UTC and zones east
|
||||||
of UTC and a minus sign for those west of UTC, hours and minutes follow each
|
of UTC and a minus sign for those west of UTC, hours and minutes follow each
|
||||||
|
|
@ -179,6 +183,7 @@ Contributors
|
||||||
* [Alexandr Nikitin](https://github.com/alexandrnikitin)
|
* [Alexandr Nikitin](https://github.com/alexandrnikitin)
|
||||||
* [Andrew Pirondini](https://github.com/andrewjpiro) of [iFixit](https://github.com/iFixit)
|
* [Andrew Pirondini](https://github.com/andrewjpiro) of [iFixit](https://github.com/iFixit)
|
||||||
* [Andrew Schaaf](https://github.com/andrewschaaf)
|
* [Andrew Schaaf](https://github.com/andrewschaaf)
|
||||||
|
* [Aryan Arora](https://github.com/aryan-debug)
|
||||||
* [Ayman Nedjmeddine](https://github.com/IOAyman)
|
* [Ayman Nedjmeddine](https://github.com/IOAyman)
|
||||||
* [Cory Heslip](https://github.com/cheslip)
|
* [Cory Heslip](https://github.com/cheslip)
|
||||||
* [Douglas de Espindola](https://github.com/douglasep)
|
* [Douglas de Espindola](https://github.com/douglasep)
|
||||||
|
|
@ -186,7 +191,9 @@ Contributors
|
||||||
* [John Zwinck](https://github.com/jzwinck)
|
* [John Zwinck](https://github.com/jzwinck)
|
||||||
* [Joost Hietbrink](https://github.com/joost)
|
* [Joost Hietbrink](https://github.com/joost)
|
||||||
* [Kevin Jin](https://github.com/Kevin-Jin)
|
* [Kevin Jin](https://github.com/Kevin-Jin)
|
||||||
|
* [Maximilian Herold](https://github.com/mherold)
|
||||||
* [Michael J.](https://github.com/michaeljayt)
|
* [Michael J.](https://github.com/michaeljayt)
|
||||||
|
* [@mogando668](https://github.com/mogando668)
|
||||||
* [Peter deHaan](https://github.com/pdehaan)
|
* [Peter deHaan](https://github.com/pdehaan)
|
||||||
* [Rob Colburn](https://github.com/robcolburn)
|
* [Rob Colburn](https://github.com/robcolburn)
|
||||||
* [Ryan Regalado](https://github.com/d48)
|
* [Ryan Regalado](https://github.com/d48)
|
||||||
|
|
@ -194,13 +201,12 @@ Contributors
|
||||||
* [Sami Samhuri](https://github.com/samsonjs)
|
* [Sami Samhuri](https://github.com/samsonjs)
|
||||||
* [Stian Grytøyr](https://github.com/stiang)
|
* [Stian Grytøyr](https://github.com/stiang)
|
||||||
* [TJ Holowaychuk](https://github.com/tj)
|
* [TJ Holowaychuk](https://github.com/tj)
|
||||||
* [w0den](https://github.com/w0den)
|
* [@w0den](https://github.com/w0den)
|
||||||
|
* [Yusuke Kawasaki](https://github.com/kawanet)
|
||||||
|
|
||||||
License
|
License
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Copyright 2010 - 2021 Sami Samhuri sami@samhuri.net
|
Copyright 2010 - 2024 Sami Samhuri sami@samhuri.net
|
||||||
|
|
||||||
[MIT license](https://sjs.mit-license.org)
|
[MIT license](https://sjs.mit-license.org)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "strftime",
|
"name": "strftime",
|
||||||
"version": "0.10.1",
|
"version": "0.10.3",
|
||||||
"main": "strftime.js",
|
"main": "strftime.js",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"Readme.md",
|
"Readme.md",
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,15 @@
|
||||||
"name": "strftime",
|
"name": "strftime",
|
||||||
"repo": "samsonjs/strftime",
|
"repo": "samsonjs/strftime",
|
||||||
"description": "strftime date formatting",
|
"description": "strftime date formatting",
|
||||||
"keywords": ["strftime", "format", "date", "time"],
|
"keywords": [
|
||||||
"version": "0.10.1",
|
"strftime",
|
||||||
|
"format",
|
||||||
|
"date",
|
||||||
|
"time"
|
||||||
|
],
|
||||||
|
"version": "0.10.3",
|
||||||
"main": "strftime.js",
|
"main": "strftime.js",
|
||||||
"scripts": ["strftime.js"]
|
"scripts": [
|
||||||
|
"strftime.js"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
17
package-lock.json
generated
Normal file
17
package-lock.json
generated
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"name": "strftime",
|
||||||
|
"version": "0.10.3",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "strftime",
|
||||||
|
"version": "0.10.3",
|
||||||
|
"license": "MIT",
|
||||||
|
"devDependencies": {},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.2.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
14
package.json
14
package.json
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "strftime",
|
"name": "strftime",
|
||||||
"description": "strftime for JavaScript",
|
"description": "strftime for JavaScript",
|
||||||
"version": "0.10.1",
|
"version": "0.10.3",
|
||||||
"homepage": "https://samhuri.net/projects/strftime",
|
"homepage": "https://samhuri.net/projects/strftime",
|
||||||
"author": "Sami Samhuri <sami@samhuri.net>",
|
"author": "Sami Samhuri <sami@samhuri.net>",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
|
|
@ -23,9 +23,17 @@
|
||||||
"Sami Samhuri <sami@samhuri.net> (https://github.com/samsonjs)",
|
"Sami Samhuri <sami@samhuri.net> (https://github.com/samsonjs)",
|
||||||
"Stian Grytøyr (https://github.com/stiang)",
|
"Stian Grytøyr (https://github.com/stiang)",
|
||||||
"TJ Holowaychuk (https://github.com/tj)",
|
"TJ Holowaychuk (https://github.com/tj)",
|
||||||
"w0den (https://github.com/w0den)"
|
"w0den (https://github.com/w0den)",
|
||||||
|
"Yusuke Kawasaki (https://github.com/kawanet)",
|
||||||
|
"Aryan Arora (https://github.com/aryan-debug)"
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
"strftime",
|
||||||
|
"format",
|
||||||
|
"string",
|
||||||
|
"time",
|
||||||
|
"date"
|
||||||
],
|
],
|
||||||
"keywords": ["strftime", "format", "string", "time", "date"],
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git://github.com/samsonjs/strftime.git"
|
"url": "git://github.com/samsonjs/strftime.git"
|
||||||
|
|
|
||||||
44
strftime-min.js
vendored
44
strftime-min.js
vendored
|
|
@ -1,23 +1,21 @@
|
||||||
(function(){function q(c,g,n){function i(c,a,e,f){for(var b="",d=null,g=!1,l=c.length,n=!1,j=0;j<l;j++){var m=c.charCodeAt(j);if(g===!0)if(m===45)d="";else if(m===95)d=" ";else if(m===48)d="0";else if(m===58)n&&t("[WARNING] detected use of unsupported %:: or %::: modifiers to strftime"),n=!0;else{switch(m){case 37:b+="%";break;case 65:b+=e.days[a.getDay()];break;case 66:b+=e.months[a.getMonth()];break;case 67:b+=h(Math.floor(a.getFullYear()/100),d);break;case 68:b+=i(e.formats.D,a,e,f);break;case 70:b+=
|
(function(){function w(e,h,q){function l(g,a,c,f){for(var b="",d=null,r=!1,J=g.length,x=!1,v=0;v<J;v++){var n=g.charCodeAt(v);if(!0===r)if(45===n)d="";else if(95===n)d=" ";else if(48===n)d="0";else if(58===n)x&&A("[WARNING] detected use of unsupported %:: or %::: modifiers to strftime"),x=!0;else{switch(n){case 37:b+="%";break;case 65:b+=c.days[a.getDay()];break;case 66:b+=c.months[a.getMonth()];break;case 67:b+=k(Math.floor(a.getFullYear()/100),d);break;case 68:b+=l(c.formats.D,a,c,f);break;case 70:b+=
|
||||||
i(e.formats.F,a,e,f);break;case 72:b+=h(a.getHours(),d);break;case 73:b+=h(u(a.getHours()),d);break;case 76:b+=Math.floor(f%1E3)>99?Math.floor(f%1E3):Math.floor(f%1E3)>9?"0"+Math.floor(f%1E3):"00"+Math.floor(f%1E3);break;case 77:b+=h(a.getMinutes(),d);break;case 80:b+=a.getHours()<12?e.am:e.pm;break;case 82:b+=i(e.formats.R,a,e,f);break;case 83:b+=h(a.getSeconds(),d);break;case 84:b+=i(e.formats.T,a,e,f);break;case 85:b+=h(v(a,"sunday"),d);break;case 87:b+=h(v(a,"monday"),d);break;case 88:b+=i(e.formats.X,
|
l(c.formats.F,a,c,f);break;case 72:b+=k(a.getHours(),d);break;case 73:b+=k(B(a.getHours()),d);break;case 76:b+=C(Math.floor(f%1E3));break;case 77:b+=k(a.getMinutes(),d);break;case 80:b+=12>a.getHours()?c.am:c.pm;break;case 82:b+=l(c.formats.R,a,c,f);break;case 83:b+=k(a.getSeconds(),d);break;case 84:b+=l(c.formats.T,a,c,f);break;case 85:b+=k(D(a,"sunday"),d);break;case 87:b+=k(D(a,"monday"),d);break;case 88:b+=l(c.formats.X,a,c,f);break;case 89:b+=a.getFullYear();break;case 90:t&&0===m?b+="GMT":(d=
|
||||||
a,e,f);break;case 89:b+=a.getFullYear();break;case 90:o&&k===0?b+="GMT":(d=a.toString().match(/\(([\w\s]+)\)/),b+=d&&d[1]||"");break;case 97:b+=e.shortDays[a.getDay()];break;case 98:b+=e.shortMonths[a.getMonth()];break;case 99:b+=i(e.formats.c,a,e,f);break;case 100:b+=h(a.getDate(),d);break;case 101:b+=h(a.getDate(),d==null?" ":d);break;case 104:b+=e.shortMonths[a.getMonth()];break;case 106:d=new Date(a.getFullYear(),0,1);d=Math.ceil((a.getTime()-d.getTime())/864E5);b+=d>99?d:d>9?"0"+d:"00"+d;break;
|
a.toString().match(/\(([\w\s]+)\)/),b+=d&&d[1]||"");break;case 97:b+=c.shortDays[a.getDay()];break;case 98:b+=c.shortMonths[a.getMonth()];break;case 99:b+=l(c.formats.c,a,c,f);break;case 100:b+=k(a.getDate(),d);break;case 101:b+=k(a.getDate(),null==d?" ":d);break;case 104:b+=c.shortMonths[a.getMonth()];break;case 106:d=new Date(a.getFullYear(),0,1);d=Math.ceil((a.getTime()-d.getTime())/864E5);b+=C(d);break;case 107:b+=k(a.getHours(),null==d?" ":d);break;case 108:b+=k(B(a.getHours()),null==d?" ":d);
|
||||||
case 107:b+=h(a.getHours(),d==null?" ":d);break;case 108:b+=h(u(a.getHours()),d==null?" ":d);break;case 109:b+=h(a.getMonth()+1,d);break;case 110:b+="\n";break;case 111:d=a.getDate();b+=e.ordinalSuffixes?String(d)+(e.ordinalSuffixes[d-1]||w(d)):String(d)+w(d);break;case 112:b+=a.getHours()<12?e.AM:e.PM;break;case 114:b+=i(e.formats.r,a,e,f);break;case 115:b+=Math.floor(f/1E3);break;case 116:b+="\t";break;case 117:d=a.getDay();b+=d===0?7:d;break;case 118:b+=i(e.formats.v,a,e,f);break;case 119:b+=a.getDay();
|
break;case 109:b+=k(a.getMonth()+1,d);break;case 110:b+="\n";break;case 111:d=a.getDate();b=c.ordinalSuffixes?b+(String(d)+(c.ordinalSuffixes[d-1]||E(d))):b+(String(d)+E(d));break;case 112:b+=12>a.getHours()?c.AM:c.PM;break;case 114:b+=l(c.formats.r,a,c,f);break;case 115:b+=Math.floor(f/1E3);break;case 116:b+="\t";break;case 117:d=a.getDay();b+=0===d?7:d;break;case 118:b+=l(c.formats.v,a,c,f);break;case 119:b+=a.getDay();break;case 120:b+=l(c.formats.x,a,c,f);break;case 121:b+=k(a.getFullYear()%100,
|
||||||
break;case 120:b+=i(e.formats.x,a,e,f);break;case 121:b+=(""+a.getFullYear()).slice(2);break;case 122:o&&k===0?b+=n?"+00:00":"+0000":(d=k!==0?k/6E4:-a.getTimezoneOffset(),g=n?":":"",m=Math.abs(d%60),b+=(d<0?"-":"+")+h(Math.floor(Math.abs(d/60)))+g+h(m));break;default:g&&(b+="%"),b+=c[j]}d=null;g=!1}else m===37?g=!0:b+=c[j]}return b}var j=c||x,k=g||0,o=n||!1,p=0,r,l=function(c,a){var e;if(a){if(e=a.getTime(),o){var f=(a.getTimezoneOffset()||0)*6E4,a=new Date(e+f+k);if((a.getTimezoneOffset()||0)*6E4!==
|
d);break;case 122:t&&0===m?b+=x?"+00:00":"+0000":(d=0!==m?m/6E4:-a.getTimezoneOffset(),r=x?":":"",n=Math.abs(d%60),b+=(0>d?"-":"+")+k(Math.floor(Math.abs(d/60)))+r+k(n));break;default:r&&(b+="%"),b+=g[v]}d=null;r=!1}else 37===n?r=!0:b+=g[v]}return b}var y=e||F,m=h||0,t=q||!1,u=0,z,p=function(g,a){if(a){var c=a.getTime();if(t){var f=6E4*(a.getTimezoneOffset()||0);a=new Date(c+f+m);6E4*(a.getTimezoneOffset()||0)!==f&&(a=6E4*(a.getTimezoneOffset()||0),a=new Date(c+a+m))}}else c=Date.now(),c>u?(u=c,z=
|
||||||
f)f=(a.getTimezoneOffset()||0)*6E4,a=new Date(e+f+k)}}else e=Date.now(),e>p?(p=e,r=new Date(p),e=p,o&&(r=new Date(p+(r.getTimezoneOffset()||0)*6E4+k))):e=p,a=r;return i(c,a,j,e)};l.localize=function(c){return new q(c||j,k,o)};l.localizeByIdentifier=function(c){var a=y[c];return!a?(t('[WARNING] No locale found with identifier "'+c+'".'),l):l.localize(a)};l.timezone=function(c){var a=k,e=o,f=typeof c;if(f==="number"||f==="string")e=!0,f==="string"?(a=c[0]==="-"?-1:1,f=parseInt(c.slice(1,3),10),c=parseInt(c.slice(3,
|
new Date(u),c=u,t&&(z=new Date(u+6E4*(z.getTimezoneOffset()||0)+m))):c=u,a=z;return l(g,a,y,c)};p.localize=function(g){return new w(g||y,m,t)};p.localizeByIdentifier=function(g){var a=G[g];return a?p.localize(a):(A('[WARNING] No locale found with identifier "'+g+'".'),p)};p.timezone=function(g){var a=m,c=t,f=typeof g;if("number"===f||"string"===f)c=!0,"string"===f?(a="-"===g[0]?-1:1,f=parseInt(g.slice(1,3),10),g=parseInt(g.slice(3,5),10),a=a*(60*f+g)*6E4):"number"===f&&(a=6E4*g);return new w(y,a,
|
||||||
5),10),a=a*(60*f+c)*6E4):f==="number"&&(a=c*6E4);return new q(j,a,e)};l.utc=function(){return new q(j,k,!0)};return l}function h(c,g){if(g===""||c>9)return c;g==null&&(g="0");return g+c}function u(c){if(c===0)return 12;else if(c>12)return c-12;return c}function v(c,g){var g=g||"sunday",h=c.getDay();g==="monday"&&(h===0?h=6:h--);var i=Date.UTC(c.getFullYear(),0,1),j=Date.UTC(c.getFullYear(),c.getMonth(),c.getDate());return Math.floor((Math.floor((j-i)/864E5)+7-h)/7)}function w(c){var g=c%10;c%=100;
|
c)};p.utc=function(){return new w(y,m,!0)};return p}function k(e,h){if(""===h||9<e)return""+e;null==h&&(h="0");return h+e}function C(e){return 99<e?e:9<e?"0"+e:"00"+e}function B(e){return 0===e?12:12<e?e-12:e}function D(e,h){h=h||"sunday";var q=e.getDay();"monday"===h&&(0===q?q=6:q--);h=Date.UTC(e.getFullYear(),0,1);e=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate());return Math.floor((Math.floor((e-h)/864E5)+7-q)/7)}function E(e){var h=e%10;e%=100;if(11<=e&&13>=e||0===h||4<=h)return"th";switch(h){case 1:return"st";
|
||||||
if(c>=11&&c<=13||g===0||g>=4)return"th";switch(g){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function t(c){typeof console!=="undefined"&&typeof console.warn=="function"&&console.warn(c)}var y={de_DE:{days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shortDays:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],shortMonths:["Jan","Feb","M\u00e4r","Apr",
|
case 2:return"nd";case 3:return"rd"}}function A(e){"undefined"!==typeof console&&"function"==typeof console.warn&&console.warn(e)}var G={de_DE:{identifier:"de-DE",days:"Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag".split(" "),shortDays:"So Mo Di Mi Do Fr Sa".split(" "),months:"Januar Februar M\u00e4rz April Mai Juni Juli August September Oktober November Dezember".split(" "),shortMonths:"Jan Feb M\u00e4r Apr Mai Jun Jul Aug Sep Okt Nov Dez".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",
|
||||||
"Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d.%m.%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},en_CA:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr",
|
formats:{c:"%a %d %b %Y %X %Z",D:"%d.%m.%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},en_CA:{identifier:"en-CA",days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),ordinalSuffixes:"st nd rd th th th th th th th th th th th th th th th th th st nd rd th th th th th th th st".split(" "),
|
||||||
"May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ordinalSuffixes:["st","nd","rd","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","st","nd","rd","th","th","th","th","th","th","th","st"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},en_US:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu",
|
AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},en_US:{identifier:"en-US",days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),ordinalSuffixes:"st nd rd th th th th th th th th th th th th th th th th th st nd rd th th th th th th th st".split(" "),
|
||||||
"Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ordinalSuffixes:["st","nd","rd","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","st","nd","rd","th","th","th","th","th","th","th","st"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%m/%d/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",
|
AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%m/%d/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},es_MX:{identifier:"es-MX",days:"domingo lunes martes mi\u00e9rcoles jueves viernes s\u00e1bado".split(" "),shortDays:"dom lun mar mi\u00e9 jue vie s\u00e1b".split(" "),months:"enero febrero marzo abril mayo junio julio agosto septiembre octubre noviembre diciembre".split(" "),shortMonths:"ene feb mar abr may jun jul ago sep oct nov dic".split(" "),
|
||||||
T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},es_MX:{days:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],shortDays:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre"," diciembre"],shortMonths:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",
|
AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},fr_FR:{identifier:"fr-FR",days:"dimanche lundi mardi mercredi jeudi vendredi samedi".split(" "),shortDays:"dim. lun. mar. mer. jeu. ven. sam.".split(" "),months:"janvier f\u00e9vrier mars avril mai juin juillet ao\u00fbt septembre octobre novembre d\u00e9cembre".split(" "),shortMonths:"janv. f\u00e9vr. mars avril mai juin juil. ao\u00fbt sept. oct. nov. d\u00e9c.".split(" "),
|
||||||
r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},fr_FR:{days:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],shortDays:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],months:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre"],shortMonths:["janv.","f\u00e9vr.","mars","avril","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c."],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",
|
AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},it_IT:{identifier:"it-IT",days:"domenica luned\u00ec marted\u00ec mercoled\u00ec gioved\u00ec venerd\u00ec sabato".split(" "),shortDays:"dom lun mar mer gio ven sab".split(" "),months:"gennaio febbraio marzo aprile maggio giugno luglio agosto settembre ottobre novembre dicembre".split(" "),shortMonths:"gen feb mar apr mag giu lug ago set ott nov dic".split(" "),
|
||||||
D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},it_IT:{days:["domenica","luned\u00ec","marted\u00ec","mercoled\u00ec","gioved\u00ec","venerd\u00ec","sabato"],shortDays:["dom","lun","mar","mer","gio","ven","sab"],months:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],shortMonths:["pr","mag","giu","lug","ago","set","ott","nov","dic"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",
|
AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},nl_NL:{identifier:"nl-NL",days:"zondag maandag dinsdag woensdag donderdag vrijdag zaterdag".split(" "),shortDays:"zo ma di wo do vr za".split(" "),months:"januari februari maart april mei juni juli augustus september oktober november december".split(" "),shortMonths:"jan feb mrt apr mei jun jul aug sep okt nov dec".split(" "),AM:"AM",PM:"PM",
|
||||||
D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},nl_NL:{days:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],shortDays:["zo","ma","di","wo","do","vr","za"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],shortMonths:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%y",
|
am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},pt_BR:{identifier:"pt-BR",days:"domingo segunda ter\u00e7a quarta quinta sexta s\u00e1bado".split(" "),shortDays:"Dom Seg Ter Qua Qui Sex S\u00e1b".split(" "),months:"janeiro fevereiro mar\u00e7o abril maio junho julho agosto setembro outubro novembro dezembro".split(" "),shortMonths:"Jan Fev Mar Abr Mai Jun Jul Ago Set Out Nov Dez".split(" "),AM:"AM",PM:"PM",
|
||||||
F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},pt_BR:{days:["domingo","segunda","ter\u00e7a","quarta","quinta","sexta","s\u00e1bado"],shortDays:["Dom","Seg","Ter","Qua","Qui","Sex","S\u00e1b"],months:["janeiro","fevereiro","mar\u00e7o","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",
|
am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},ru_RU:{identifier:"ru-RU",days:"\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435 \u041f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a \u0412\u0442\u043e\u0440\u043d\u0438\u043a \u0421\u0440\u0435\u0434\u0430 \u0427\u0435\u0442\u0432\u0435\u0440\u0433 \u041f\u044f\u0442\u043d\u0438\u0446\u0430 \u0421\u0443\u0431\u0431\u043e\u0442\u0430".split(" "),
|
||||||
D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},ru_RU:{days:["\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0412\u0442\u043e\u0440\u043d\u0438\u043a","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0435\u0440\u0433","\u041f\u044f\u0442\u043d\u0438\u0446\u0430","\u0421\u0443\u0431\u0431\u043e\u0442\u0430"],shortDays:["\u0412\u0441","\u041f\u043d","\u0412\u0442",
|
shortDays:"\u0412\u0441 \u041f\u043d \u0412\u0442 \u0421\u0440 \u0427\u0442 \u041f\u0442 \u0421\u0431".split(" "),months:"\u042f\u043d\u0432\u0430\u0440\u044c \u0424\u0435\u0432\u0440\u0430\u043b\u044c \u041c\u0430\u0440\u0442 \u0410\u043f\u0440\u0435\u043b\u044c \u041c\u0430\u0439 \u0418\u044e\u043d\u044c \u0418\u044e\u043b\u044c \u0410\u0432\u0433\u0443\u0441\u0442 \u0421\u0435\u043d\u0442\u044f\u0431\u0440\u044c \u041e\u043a\u0442\u044f\u0431\u0440\u044c \u041d\u043e\u044f\u0431\u0440\u044c \u0414\u0435\u043a\u0430\u0431\u0440\u044c".split(" "),
|
||||||
"\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],months:["\u042f\u043d\u0432\u0430\u0440\u044c","\u0424\u0435\u0432\u0440\u0430\u043b\u044c","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0435\u043b\u044c","\u041c\u0430\u0439","\u0418\u044e\u043d\u044c","\u0418\u044e\u043b\u044c","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043d\u0442\u044f\u0431\u0440\u044c","\u041e\u043a\u0442\u044f\u0431\u0440\u044c","\u041d\u043e\u044f\u0431\u0440\u044c","\u0414\u0435\u043a\u0430\u0431\u0440\u044c"],
|
shortMonths:"\u044f\u043d\u0432 \u0444\u0435\u0432 \u043c\u0430\u0440 \u0430\u043f\u0440 \u043c\u0430\u0439 \u0438\u044e\u043d \u0438\u044e\u043b \u0430\u0432\u0433 \u0441\u0435\u043d \u043e\u043a\u0442 \u043d\u043e\u044f \u0434\u0435\u043a".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X",D:"%d.%m.%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},tr_TR:{identifier:"tr-TR",days:"Pazar Pazartesi Sal\u0131 \u00c7ar\u015famba Per\u015fembe Cuma Cumartesi".split(" "),
|
||||||
shortMonths:["\u044f\u043d\u0432","\u0444\u0435\u0432","\u043c\u0430\u0440","\u0430\u043f\u0440","\u043c\u0430\u0439","\u0438\u044e\u043d","\u0438\u044e\u043b","\u0430\u0432\u0433","\u0441\u0435\u043d","\u043e\u043a\u0442","\u043d\u043e\u044f","\u0434\u0435\u043a"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X",D:"%d.%m.%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},tr_TR:{days:["Pazar","Pazartesi","Sal\u0131","\u00c7ar\u015famba","Per\u015fembe",
|
shortDays:"Paz Pzt Sal \u00c7r\u015f Pr\u015f Cum Cts".split(" "),months:"Ocak \u015eubat Mart Nisan May\u0131s Haziran Temmuz A\u011fustos Eyl\u00fcl Ekim Kas\u0131m Aral\u0131k".split(" "),shortMonths:"Oca \u015eub Mar Nis May Haz Tem A\u011fu Eyl Eki Kas Ara".split(" "),AM:"\u00d6\u00d6",PM:"\u00d6S",am:"\u00d6\u00d6",pm:"\u00d6S",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},zh_CN:{identifier:"zh-CN",days:"\u661f\u671f\u65e5 \u661f\u671f\u4e00 \u661f\u671f\u4e8c \u661f\u671f\u4e09 \u661f\u671f\u56db \u661f\u671f\u4e94 \u661f\u671f\u516d".split(" "),
|
||||||
"Cuma","Cumartesi"],shortDays:["Paz","Pzt","Sal","\u00c7r\u015f","Pr\u015f","Cum","Cts"],months:["Ocak","\u015eubat","Mart","Nisan","May\u0131s","Haziran","Temmuz","A\u011fustos","Eyl\u00fcl","Ekim","Kas\u0131m","Aral\u0131k"],shortMonths:["Oca","\u015eub","Mar","Nis","May","Haz","Tem","A\u011fu","Eyl","Eki","Kas","Ara"],AM:"\u00d6\u00d6",PM:"\u00d6S",am:"\u00d6\u00d6",pm:"\u00d6S",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",
|
shortDays:"\u65e5\u4e00\u4e8c\u4e09\u56db\u4e94\u516d".split(""),months:"\u4e00\u6708 \u4e8c\u6708 \u4e09\u6708 \u56db\u6708 \u4e94\u6708 \u516d\u6708 \u4e03\u6708 \u516b\u6708 \u4e5d\u6708 \u5341\u6708 \u5341\u4e00\u6708 \u5341\u4e8c\u6708".split(" "),shortMonths:"\u4e00\u6708 \u4e8c\u6708 \u4e09\u6708 \u56db\u6708 \u4e94\u6708 \u516d\u6708 \u4e03\u6708 \u516b\u6708 \u4e5d\u6708 \u5341\u6708 \u5341\u4e00\u6708 \u5341\u4e8c\u6708".split(" "),AM:"\u4e0a\u5348",PM:"\u4e0b\u5348",am:"\u4e0a\u5348",pm:"\u4e0b\u5348",
|
||||||
x:"%D"}},zh_CN:{days:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],shortDays:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],months:["\u4e00\u6708\u4efd","\u4e8c\u6708\u4efd","\u4e09\u6708\u4efd","\u56db\u6708\u4efd","\u4e94\u6708\u4efd","\u516d\u6708\u4efd","\u4e03\u6708\u4efd","\u516b\u6708\u4efd","\u4e5d\u6708\u4efd","\u5341\u6708\u4efd","\u5341\u4e00\u6708\u4efd","\u5341\u4e8c\u6708\u4efd"],
|
formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}}},F=G.en_US,H=new w(F,0,!1);if("undefined"!==typeof module)var I=module.exports=H;else I=function(){return this||(0,eval)("this")}(),I.strftime=H;"function"!==typeof Date.now&&(Date.now=function(){return+new Date})})();
|
||||||
shortMonths:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],AM:"\u4e0a\u5348",PM:"\u4e0b\u5348",am:"\u4e0a\u5348",pm:"\u4e0b\u5348",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}}},x=y.en_US,z=new q(x,0,!1),s;typeof module!=="undefined"?s=module.exports=z:(s=function(){return this||
|
|
||||||
(0,eval)("this")}(),s.strftime=z);if(typeof Date.now!=="function")Date.now=function(){return+new Date}})();
|
|
||||||
|
|
|
||||||
42
strftime.js
42
strftime.js
|
|
@ -9,7 +9,7 @@
|
||||||
// http://sjs.mit-license.org
|
// http://sjs.mit-license.org
|
||||||
//
|
//
|
||||||
|
|
||||||
;(function() {
|
; (function () {
|
||||||
|
|
||||||
var Locales = {
|
var Locales = {
|
||||||
de_DE: {
|
de_DE: {
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
en_CA: {
|
en_CA: {
|
||||||
identifier: 'en-CA',
|
identifier: 'en-CA',
|
||||||
days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ],
|
days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
||||||
shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
||||||
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
||||||
shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
|
|
||||||
en_US: {
|
en_US: {
|
||||||
identifier: 'en-US',
|
identifier: 'en-US',
|
||||||
days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ],
|
days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
||||||
shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
||||||
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
||||||
shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
||||||
|
|
@ -97,7 +97,7 @@
|
||||||
identifier: 'es-MX',
|
identifier: 'es-MX',
|
||||||
days: ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'],
|
days: ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'],
|
||||||
shortDays: ['dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb'],
|
shortDays: ['dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb'],
|
||||||
months: ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre',' diciembre'],
|
months: ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'],
|
||||||
shortMonths: ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'],
|
shortMonths: ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'],
|
||||||
AM: 'AM',
|
AM: 'AM',
|
||||||
PM: 'PM',
|
PM: 'PM',
|
||||||
|
|
@ -233,7 +233,7 @@
|
||||||
|
|
||||||
tr_TR: {
|
tr_TR: {
|
||||||
identifier: 'tr-TR',
|
identifier: 'tr-TR',
|
||||||
days: ['Pazar', 'Pazartesi', 'Salı','Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'],
|
days: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'],
|
||||||
shortDays: ['Paz', 'Pzt', 'Sal', 'Çrş', 'Prş', 'Cum', 'Cts'],
|
shortDays: ['Paz', 'Pzt', 'Sal', 'Çrş', 'Prş', 'Cum', 'Cts'],
|
||||||
months: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'],
|
months: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'],
|
||||||
shortMonths: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'],
|
shortMonths: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'],
|
||||||
|
|
@ -260,7 +260,7 @@
|
||||||
identifier: 'zh-CN',
|
identifier: 'zh-CN',
|
||||||
days: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
|
days: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
|
||||||
shortDays: ['日', '一', '二', '三', '四', '五', '六'],
|
shortDays: ['日', '一', '二', '三', '四', '五', '六'],
|
||||||
months: ['一月份', '二月份', '三月份', '四月份', '五月份', '六月份', '七月份', '八月份', '九月份', '十月份', '十一月份', '十二月份'],
|
months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
||||||
shortMonths: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
shortMonths: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
|
||||||
AM: '上午',
|
AM: '上午',
|
||||||
PM: '下午',
|
PM: '下午',
|
||||||
|
|
@ -292,14 +292,14 @@
|
||||||
// Browsers and other environments
|
// Browsers and other environments
|
||||||
else {
|
else {
|
||||||
// Get the global object. Works in ES3, ES5, and ES5 strict mode.
|
// Get the global object. Works in ES3, ES5, and ES5 strict mode.
|
||||||
namespace = (function() { return this || (1,eval)('this'); }());
|
namespace = (function () { return this || (1, eval)('this'); }());
|
||||||
namespace.strftime = defaultStrftime;
|
namespace.strftime = defaultStrftime;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Polyfill Date.now for old browsers.
|
// Polyfill Date.now for old browsers.
|
||||||
if (typeof Date.now !== 'function') {
|
if (typeof Date.now !== 'function') {
|
||||||
Date.now = function() {
|
Date.now = function () {
|
||||||
return +new Date();
|
return +new Date();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -333,7 +333,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
timestamp = _cachedDateTimestamp;
|
timestamp = _cachedDateTimestamp;
|
||||||
}
|
}
|
||||||
date = _cachedDate;
|
date = _cachedDate;
|
||||||
}
|
}
|
||||||
|
|
@ -384,11 +384,11 @@
|
||||||
}
|
}
|
||||||
// ':'
|
// ':'
|
||||||
else if (currentCharCode === 58) {
|
else if (currentCharCode === 58) {
|
||||||
if (extendedTZ) {
|
if (extendedTZ) {
|
||||||
warn("[WARNING] detected use of unsupported %:: or %::: modifiers to strftime");
|
warn("[WARNING] detected use of unsupported %:: or %::: modifiers to strftime");
|
||||||
}
|
}
|
||||||
extendedTZ = true;
|
extendedTZ = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (currentCharCode) {
|
switch (currentCharCode) {
|
||||||
|
|
@ -649,7 +649,7 @@
|
||||||
// '70'
|
// '70'
|
||||||
// case 'y':
|
// case 'y':
|
||||||
case 121:
|
case 121:
|
||||||
resultString += ('' + date.getFullYear()).slice(2);
|
resultString += padTill2(date.getFullYear() % 100, padding);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// '+0000'
|
// '+0000'
|
||||||
|
|
@ -701,11 +701,11 @@
|
||||||
|
|
||||||
var strftime = _strftime;
|
var strftime = _strftime;
|
||||||
|
|
||||||
strftime.localize = function(locale) {
|
strftime.localize = function (locale) {
|
||||||
return new Strftime(locale || _locale, _customTimezoneOffset, _useUtcBasedDate);
|
return new Strftime(locale || _locale, _customTimezoneOffset, _useUtcBasedDate);
|
||||||
};
|
};
|
||||||
|
|
||||||
strftime.localizeByIdentifier = function(localeIdentifier) {
|
strftime.localizeByIdentifier = function (localeIdentifier) {
|
||||||
var locale = Locales[localeIdentifier];
|
var locale = Locales[localeIdentifier];
|
||||||
if (!locale) {
|
if (!locale) {
|
||||||
warn('[WARNING] No locale found with identifier "' + localeIdentifier + '".');
|
warn('[WARNING] No locale found with identifier "' + localeIdentifier + '".');
|
||||||
|
|
@ -714,7 +714,7 @@
|
||||||
return strftime.localize(locale);
|
return strftime.localize(locale);
|
||||||
};
|
};
|
||||||
|
|
||||||
strftime.timezone = function(timezone) {
|
strftime.timezone = function (timezone) {
|
||||||
var customTimezoneOffset = _customTimezoneOffset;
|
var customTimezoneOffset = _customTimezoneOffset;
|
||||||
var useUtcBasedDate = _useUtcBasedDate;
|
var useUtcBasedDate = _useUtcBasedDate;
|
||||||
|
|
||||||
|
|
@ -739,7 +739,7 @@
|
||||||
return new Strftime(_locale, customTimezoneOffset, useUtcBasedDate);
|
return new Strftime(_locale, customTimezoneOffset, useUtcBasedDate);
|
||||||
};
|
};
|
||||||
|
|
||||||
strftime.utc = function() {
|
strftime.utc = function () {
|
||||||
return new Strftime(_locale, _customTimezoneOffset, true);
|
return new Strftime(_locale, _customTimezoneOffset, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -748,7 +748,7 @@
|
||||||
|
|
||||||
function padTill2(numberToPad, paddingChar) {
|
function padTill2(numberToPad, paddingChar) {
|
||||||
if (paddingChar === '' || numberToPad > 9) {
|
if (paddingChar === '' || numberToPad > 9) {
|
||||||
return numberToPad;
|
return '' + numberToPad;
|
||||||
}
|
}
|
||||||
if (paddingChar == null) {
|
if (paddingChar == null) {
|
||||||
paddingChar = '0';
|
paddingChar = '0';
|
||||||
|
|
|
||||||
4
test.js
4
test.js
|
|
@ -38,7 +38,7 @@ if (process.env.TZ == 'America/Vancouver') {
|
||||||
testTimezone('America/Vancouver');
|
testTimezone('America/Vancouver');
|
||||||
assert.format('%C', '01', '01', new Date(100, 0, 1));
|
assert.format('%C', '01', '01', new Date(100, 0, 1));
|
||||||
assert.format('%X', '11:51:45 AM', '06:51:45 PM');
|
assert.format('%X', '11:51:45 AM', '06:51:45 PM');
|
||||||
assert.format('%c', 'Tue 07 Jun 2011 11:51:45 AM Pacific Daylight Time', 'Tue 07 Jun 2011 06:51:45 PM GMT');
|
assert.format('%c', 'Tue 07 Jun 2011 11:51:45 AM Pacific Daylight Saving Time', 'Tue 07 Jun 2011 06:51:45 PM GMT');
|
||||||
assert.format('%j', '097', '098', new Date(1365390736236));
|
assert.format('%j', '097', '098', new Date(1365390736236));
|
||||||
assert.format('%x', '06/07/11');
|
assert.format('%x', '06/07/11');
|
||||||
assert.format('%U', '12', null, new Date('2017-03-25 00:00:00 +0000'));
|
assert.format('%U', '12', null, new Date('2017-03-25 00:00:00 +0000'));
|
||||||
|
|
@ -100,6 +100,8 @@ assert.format('%k', null, '18');
|
||||||
assert.format('%L', '067');
|
assert.format('%L', '067');
|
||||||
assert.format('%l', null, ' 6');
|
assert.format('%l', null, ' 6');
|
||||||
assert.format('%-l', null, '6');
|
assert.format('%-l', null, '6');
|
||||||
|
assert.format("%-y", "1", null, new Date('2001-02-03T04:05:06'))
|
||||||
|
assert.format("%-y", "23", null, new Date('2023-02-03T04:05:06'))
|
||||||
assert.format('%_l', null, ' 6');
|
assert.format('%_l', null, ' 6');
|
||||||
assert.format('%0l', null, '06');
|
assert.format('%0l', null, '06');
|
||||||
assert.format('%M', null, '51');
|
assert.format('%M', null, '51');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue