File: strftime.min.js

package info (click to toggle)
r-cran-shiny 1.5.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 8,224 kB
  • sloc: javascript: 17,081; sh: 28; makefile: 21
file content (18 lines) | stat: -rw-r--r-- 9,686 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(function(){function t(c,g,r){function l(c,b,d,f){for(var a="",e=null,g=!1,p=c.length,r=!1,m=0;m<p;m++){var q=c.charCodeAt(m);if(!0===g)if(45===q)e="";else if(95===q)e=" ";else if(48===q)e="0";else if(58===q)r&&w("[WARNING] detected use of unsupported %:: or %::: modifiers to strftime"),r=!0;else{switch(q){case 37:a+="%";break;case 65:a+=d.days[b.getDay()];break;case 66:a+=d.months[b.getMonth()];break;case 67:a+=h(Math.floor(b.getFullYear()/100),e);break;case 68:a+=l(d.formats.D,b,d,f);break;case 70:a+=
l(d.formats.F,b,d,f);break;case 72:a+=h(b.getHours(),e);break;case 73:a+=h(x(b.getHours()),e);break;case 76:a+=99<Math.floor(f%1E3)?Math.floor(f%1E3):9<Math.floor(f%1E3)?"0"+Math.floor(f%1E3):"00"+Math.floor(f%1E3);break;case 77:a+=h(b.getMinutes(),e);break;case 80:a+=12>b.getHours()?d.am:d.pm;break;case 82:a+=l(d.formats.R,b,d,f);break;case 83:a+=h(b.getSeconds(),e);break;case 84:a+=l(d.formats.T,b,d,f);break;case 85:a+=h(y(b,"sunday"),e);break;case 87:a+=h(y(b,"monday"),e);break;case 88:a+=l(d.formats.X,
b,d,f);break;case 89:a+=b.getFullYear();break;case 90:s&&0===n?a+="GMT":(e=b.toString().match(/\(([\w\s]+)\)/),a+=e&&e[1]||"");break;case 97:a+=d.shortDays[b.getDay()];break;case 98:a+=d.shortMonths[b.getMonth()];break;case 99:a+=l(d.formats.c,b,d,f);break;case 100:a+=h(b.getDate(),e);break;case 101:a+=h(b.getDate(),null==e?" ":e);break;case 104:a+=d.shortMonths[b.getMonth()];break;case 106:e=new Date(b.getFullYear(),0,1);e=Math.ceil((b.getTime()-e.getTime())/864E5);a+=99<e?e:9<e?"0"+e:"00"+e;break;
case 107:a+=h(b.getHours(),null==e?" ":e);break;case 108:a+=h(x(b.getHours()),null==e?" ":e);break;case 109:a+=h(b.getMonth()+1,e);break;case 110:a+="\n";break;case 111:e=b.getDate();a=d.ordinalSuffixes?a+(String(e)+(d.ordinalSuffixes[e-1]||z(e))):a+(String(e)+z(e));break;case 112:a+=12>b.getHours()?d.AM:d.PM;break;case 114:a+=l(d.formats.r,b,d,f);break;case 115:a+=Math.floor(f/1E3);break;case 116:a+="\t";break;case 117:e=b.getDay();a+=0===e?7:e;break;case 118:a+=l(d.formats.v,b,d,f);break;case 119:a+=
b.getDay();break;case 120:a+=l(d.formats.x,b,d,f);break;case 121:a+=(""+b.getFullYear()).slice(2);break;case 122:if(s&&0===n)a+=r?"+00:00":"+0000";else{var k;k=0!==n?n/6E4:-b.getTimezoneOffset();e=0>k?"-":"+";g=r?":":"";q=Math.floor(Math.abs(k/60));k=Math.abs(k%60);a+=e+h(q)+g+h(k)}break;default:g&&(a+="%"),a+=c[m]}e=null;g=!1}else 37===q?g=!0:a+=c[m]}return a}var m=c||A,n=g||0,s=r||!1,k=0,u,p=function(c,b){var d;if(b){if(d=b.getTime(),s){var f=6E4*(b.getTimezoneOffset()||0);b=new Date(d+f+n);if(6E4*
(b.getTimezoneOffset()||0)!==f)f=6E4*(b.getTimezoneOffset()||0),b=new Date(d+f+n)}}else d=Date.now(),d>k?(k=d,u=new Date(k),d=k,s&&(u=new Date(k+6E4*(u.getTimezoneOffset()||0)+n))):d=k,b=u;return l(c,b,m,d)};p.localize=function(c){return new t(c||m,n,s)};p.localizeByIdentifier=function(c){var b=B[c];return!b?(w('[WARNING] No locale found with identifier "'+c+'".'),p):p.localize(b)};p.timezone=function(c){var b=n,d=s,f=typeof c;if("number"===f||"string"===f)d=!0,"string"===f?(b="-"===c[0]?-1:1,f=parseInt(c.slice(1,
3),10),c=parseInt(c.slice(3,5),10),b=6E4*b*(60*f+c)):"number"===f&&(b=6E4*c);return new t(m,b,d)};p.utc=function(){return new t(m,n,!0)};return p}function h(c,g){if(""===g||9<c)return c;null==g&&(g="0");return g+c}function x(c){return 0===c?12:12<c?c-12:c}function y(c,g){g=g||"sunday";var h=c.getDay();"monday"===g&&(0===h?h=6:h--);var l=Date.UTC(c.getFullYear(),0,1),m=Date.UTC(c.getFullYear(),c.getMonth(),c.getDate());return Math.floor((Math.floor((m-l)/864E5)+7-h)/7)}function z(c){var g=c%10;c%=
100;if(11<=c&&13>=c||0===g||4<=g)return"th";switch(g){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function w(c){"undefined"!==typeof console&&"function"==typeof console.warn&&console.warn(c)}var B={de_DE:{days:"Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag".split(" "),shortDays:"So Mo Di Mi Do Fr Sa".split(" "),months:"Januar Februar März April Mai Juni Juli August September Oktober November Dezember".split(" "),shortMonths:"Jan Feb Mär Apr Mai Jun Jul Aug Sep Okt Nov Dez".split(" "),
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".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(" "),
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".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(" "),
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:{days:"domingo lunes martes miércoles jueves viernes sábado".split(" "),shortDays:"dom lun mar mié jue vie sáb".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(" "),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:{days:"dimanche lundi mardi mercredi jeudi vendredi samedi".split(" "),shortDays:"dim. lun. mar. mer. jeu. ven. sam.".split(" "),months:"janvier février mars avril mai juin juillet août septembre octobre novembre décembre".split(" "),shortMonths:"janv. févr. mars avril mai juin juil. août sept. oct. nov. déc.".split(" "),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:{days:"domenica lunedì martedì mercoledì giovedì venerdì 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:"pr mag giu lug ago set ott nov dic".split(" "),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:{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",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:{days:"domingo segunda terça quarta quinta sexta sábado".split(" "),shortDays:"Dom Seg Ter Qua Qui Sex Sáb".split(" "),months:"janeiro fevereiro março 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",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:{days:"Воскресенье Понедельник Вторник Среда Четверг Пятница Суббота".split(" "),
shortDays:"Вс Пн Вт Ср Чт Пт Сб".split(" "),months:"Январь Февраль Март Апрель Май Июнь Июль Август Сентябрь Октябрь Ноябрь Декабрь".split(" "),shortMonths:"янв фев мар апр май июн июл авг сен окт ноя дек".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:{days:"Pazar Pazartesi Salı Çarşamba Perşembe Cuma Cumartesi".split(" "),shortDays:"Paz Pzt Sal Çrş Prş Cum Cts".split(" "),
months:"Ocak Şubat Mart Nisan Mayıs Haziran Temmuz Ağustos Eylül Ekim Kasım Aralık".split(" "),shortMonths:"Oca Şub Mar Nis May Haz Tem Ağu Eyl Eki Kas Ara".split(" "),AM:"ÖÖ",PM:"ÖS",am:"ÖÖ",pm:"ÖS",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:{days:"星期日 星期一 星期二 星期三 星期四 星期五 星期六".split(" "),shortDays:"日一二三四五六".split(""),months:"一月份 二月份 三月份 四月份 五月份 六月份 七月份 八月份 九月份 十月份 十一月份 十二月份".split(" "),shortMonths:"一月 二月 三月 四月 五月 六月 七月 八月 九月 十月 十一月 十二月".split(" "),
AM:"上午",PM:"下午",am:"上午",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"}}},A=B.en_US,C=new t(A,0,!1),v;"undefined"!==typeof module?v=module.exports=C:(v=function(){return this||(0,eval)("this")}(),v.strftime=C);"function"!==typeof Date.now&&(Date.now=function(){return+new Date})})();