-
Notifications
You must be signed in to change notification settings - Fork 9
/
dtf.min.js
7 lines (7 loc) · 2.05 KB
/
dtf.min.js
1
2
3
4
5
6
7
/**
* dtf 1.0.0
* https://github.com/zloirock/dtf
* License: http://rock.mit-license.org
* © 2015 Denis Pushkarev
*/
!function(){function n(a,c){try{Object.defineProperty(b,a,{configurable:!0,writable:!0,value:c})}catch(d){b[a]=c}}function o(a){return a>9?a:"0"+a}function p(a,b,e,n){function q(c){return a[b+c]()}var p=f[c.call(f,n)?n:g];return String(e).replace(d,function(a){switch(a){case"s":return q(h);case"ss":return o(q(h));case"m":return q(i);case"mm":return o(q(i));case"h":return q(j);case"hh":return o(q(j));case"D":return q(k);case"DD":return o(q(k));case"W":return p[0][q("Day")];case"N":return q(l)+1;case"NN":return o(q(l)+1);case"M":return p[2][q(l)];case"MM":return p[1][q(l)];case"Y":return q(m);case"YY":return o(q(m)%100)}return a})}function q(a,b){function c(a){for(var c=Array(7),d=b.months.split(","),f=0;7>f;)c[f]=d[f++].replace(e,"$"+a);return c}return f[a]=[b.weekdays.split(","),c(1),c(2)],r}var a="undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),b=Date.prototype,c={}.hasOwnProperty,d=/\b\w\w?\b/g,e=/:(.*)\|(.*)$/,f={},g="en",h="Seconds",i="Minutes",j="Hours",k="Date",l="Month",m="FullYear",r={format:function(a,b,c){return p(a,"get",b,c)},formatUTC:function(a,b,c){return p(a,"getUTC",b,c)},addLocale:q,locale:function(a){return c.call(f,a)?g=a:g},extend:function(){return n("format",function(a,b){return p(this,"get",a,b)}),n("formatUTC",function(a,b){return p(this,"getUTC",a,b)}),r}};q(g,{weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",months:"January,February,March,April,May,June,July,August,September,October,November,December"}),q("ru",{weekdays:"Воскресенье,Понедельник,Вторник,Среда,Четверг,Пятница,Суббота",months:"Январ:я|ь,Феврал:я|ь,Март:а|,Апрел:я|ь,Ма:я|й,Июн:я|ь,Июл:я|ь,Август:а|,Сентябр:я|ь,Октябр:я|ь,Ноябр:я|ь,Декабр:я|ь"}),"undefined"!=typeof module&&module.exports?module.exports=r:"function"==typeof define&&define.amd?define(function(){return r}):a.dtf=r}();