├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── CLA.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── TODO.md ├── build ├── core.js ├── date-af-ZA.js ├── date-ar-AE.js ├── date-ar-BH.js ├── date-ar-DZ.js ├── date-ar-EG.js ├── date-ar-IQ.js ├── date-ar-JO.js ├── date-ar-KW.js ├── date-ar-LB.js ├── date-ar-LY.js ├── date-ar-MA.js ├── date-ar-OM.js ├── date-ar-QA.js ├── date-ar-SA.js ├── date-ar-SY.js ├── date-ar-TN.js ├── date-ar-YE.js ├── date-az-Cyrl-AZ.js ├── date-az-Latn-AZ.js ├── date-be-BY.js ├── date-bg-BG.js ├── date-bs-Latn-BA.js ├── date-ca-ES.js ├── date-cs-CZ.js ├── date-cy-GB.js ├── date-da-DK.js ├── date-de-AT.js ├── date-de-CH.js ├── date-de-DE.js ├── date-de-LI.js ├── date-de-LU.js ├── date-dv-MV.js ├── date-el-GR.js ├── date-en-029.js ├── date-en-AU.js ├── date-en-BZ.js ├── date-en-CA.js ├── date-en-GB.js ├── date-en-IE.js ├── date-en-JM.js ├── date-en-NZ.js ├── date-en-PH.js ├── date-en-TT.js ├── date-en-US.js ├── date-en-ZA.js ├── date-en-ZW.js ├── date-es-AR.js ├── date-es-BO.js ├── date-es-CL.js ├── date-es-CO.js ├── date-es-CR.js ├── date-es-DO.js ├── date-es-EC.js ├── date-es-ES.js ├── date-es-GT.js ├── date-es-HN.js ├── date-es-MX.js ├── date-es-NI.js ├── date-es-PA.js ├── date-es-PE.js ├── date-es-PR.js ├── date-es-PY.js ├── date-es-SV.js ├── date-es-UY.js ├── date-es-VE.js ├── date-et-EE.js ├── date-eu-ES.js ├── date-fa-IR.js ├── date-fi-FI.js ├── date-fo-FO.js ├── date-fr-BE.js ├── date-fr-CA.js ├── date-fr-CH.js ├── date-fr-FR.js ├── date-fr-LU.js ├── date-fr-MC.js ├── date-gl-ES.js ├── date-gu-IN.js ├── date-he-IL.js ├── date-hi-IN.js ├── date-hr-BA.js ├── date-hr-HR.js ├── date-hu-HU.js ├── date-hy-AM.js ├── date-id-ID.js ├── date-is-IS.js ├── date-it-CH.js ├── date-it-IT.js ├── date-ja-JP.js ├── date-ka-GE.js ├── date-kk-KZ.js ├── date-kn-IN.js ├── date-ko-KR.js ├── date-kok-IN.js ├── date-ky-KG.js ├── date-lt-LT.js ├── date-lv-LV.js ├── date-mi-NZ.js ├── date-mk-MK.js ├── date-mn-MN.js ├── date-mr-IN.js ├── date-ms-BN.js ├── date-ms-MY.js ├── date-mt-MT.js ├── date-nb-NO.js ├── date-nl-BE.js ├── date-nl-NL.js ├── date-nn-NO.js ├── date-ns-ZA.js ├── date-pa-IN.js ├── date-pl-PL.js ├── date-pt-BR.js ├── date-pt-PT.js ├── date-quz-BO.js ├── date-quz-EC.js ├── date-quz-PE.js ├── date-ro-RO.js ├── date-ru-RU.js ├── date-sa-IN.js ├── date-se-FI.js ├── date-se-NO.js ├── date-se-SE.js ├── date-sk-SK.js ├── date-sl-SI.js ├── date-sma-NO.js ├── date-sma-SE.js ├── date-smj-NO.js ├── date-smj-SE.js ├── date-smn-FI.js ├── date-sms-FI.js ├── date-sq-AL.js ├── date-sr-Cyrl-BA.js ├── date-sr-Cyrl-CS.js ├── date-sr-Latn-BA.js ├── date-sr-Latn-CS.js ├── date-sv-FI.js ├── date-sv-SE.js ├── date-sw-KE.js ├── date-syr-SY.js ├── date-ta-IN.js ├── date-te-IN.js ├── date-th-TH.js ├── date-tn-ZA.js ├── date-tr-TR.js ├── date-tt-RU.js ├── date-uk-UA.js ├── date-ur-PK.js ├── date-uz-Cyrl-UZ.js ├── date-uz-Latn-UZ.js ├── date-vi-VN.js ├── date-xh-ZA.js ├── date-zh-CN.js ├── date-zh-HK.js ├── date-zh-MO.js ├── date-zh-SG.js ├── date-zh-TW.js ├── date-zu-ZA.js ├── date.js ├── extras.js ├── parser.js ├── sugarpak.js └── time.js ├── gulpfile.js ├── package-lock.json ├── package.json ├── src ├── core.js ├── date.js ├── extras.js ├── globalization │ ├── af-ZA.js │ ├── ar-AE.js │ ├── ar-BH.js │ ├── ar-DJ.js │ ├── ar-DZ.js │ ├── ar-EG.js │ ├── ar-IQ.js │ ├── ar-JO.js │ ├── ar-KM.js │ ├── ar-KW.js │ ├── ar-LB.js │ ├── ar-LY.js │ ├── ar-MA.js │ ├── ar-MR.js │ ├── ar-OM.js │ ├── ar-PS.js │ ├── ar-QA.js │ ├── ar-SA.js │ ├── ar-SD.js │ ├── ar-SO.js │ ├── ar-SY.js │ ├── ar-TN.js │ ├── ar-YE.js │ ├── az-Cyrl-AZ.js │ ├── az-Latn-AZ.js │ ├── be-BY.js │ ├── bg-BG.js │ ├── bs-Latn-BA.js │ ├── ca-ES.js │ ├── cs-CZ.js │ ├── cy-GB.js │ ├── da-DK.js │ ├── de-AT.js │ ├── de-CH.js │ ├── de-DE.js │ ├── de-LI.js │ ├── de-LU.js │ ├── dv-MV.js │ ├── el-GR.js │ ├── en-029.js │ ├── en-AU.js │ ├── en-BZ.js │ ├── en-CA.js │ ├── en-GB.js │ ├── en-IE.js │ ├── en-JM.js │ ├── en-NZ.js │ ├── en-PH.js │ ├── en-TT.js │ ├── en-US.js │ ├── en-ZA.js │ ├── en-ZW.js │ ├── es-AR.js │ ├── es-BO.js │ ├── es-CL.js │ ├── es-CO.js │ ├── es-CR.js │ ├── es-DO.js │ ├── es-EC.js │ ├── es-ES.js │ ├── es-GT.js │ ├── es-HN.js │ ├── es-MX.js │ ├── es-NI.js │ ├── es-PA.js │ ├── es-PE.js │ ├── es-PR.js │ ├── es-PY.js │ ├── es-SV.js │ ├── es-UY.js │ ├── es-VE.js │ ├── et-EE.js │ ├── eu-ES.js │ ├── fa-IR.js │ ├── fi-FI.js │ ├── fo-FO.js │ ├── fr-BE.js │ ├── fr-CA.js │ ├── fr-CH.js │ ├── fr-FR.js │ ├── fr-LU.js │ ├── fr-MC.js │ ├── gl-ES.js │ ├── gu-IN.js │ ├── he-IL.js │ ├── hi-IN.js │ ├── hr-BA.js │ ├── hr-HR.js │ ├── hu-HU.js │ ├── hy-AM.js │ ├── id-ID.js │ ├── is-IS.js │ ├── it-CH.js │ ├── it-IT.js │ ├── ja-JP.js │ ├── ka-GE.js │ ├── kab-DZ.js │ ├── kk-KZ.js │ ├── kn-IN.js │ ├── ko-KR.js │ ├── kok-IN.js │ ├── ky-KG.js │ ├── lt-LT.js │ ├── lv-LV.js │ ├── mi-NZ.js │ ├── mk-MK.js │ ├── mn-MN.js │ ├── mr-IN.js │ ├── ms-BN.js │ ├── ms-MY.js │ ├── mt-MT.js │ ├── nb-NO.js │ ├── nl-BE.js │ ├── nl-NL.js │ ├── nn-NO.js │ ├── ns-ZA.js │ ├── pa-IN.js │ ├── pl-PL.js │ ├── pt-BR.js │ ├── pt-PT.js │ ├── quz-BO.js │ ├── quz-EC.js │ ├── quz-PE.js │ ├── ro-RO.js │ ├── ru-RU.js │ ├── sa-IN.js │ ├── se-FI.js │ ├── se-NO.js │ ├── se-SE.js │ ├── sk-SK.js │ ├── sl-SI.js │ ├── sma-NO.js │ ├── sma-SE.js │ ├── smj-NO.js │ ├── smj-SE.js │ ├── smn-FI.js │ ├── sms-FI.js │ ├── sq-AL.js │ ├── sr-Cyrl-BA.js │ ├── sr-Cyrl-CS.js │ ├── sr-Latn-BA.js │ ├── sr-Latn-CS.js │ ├── sv-FI.js │ ├── sv-SE.js │ ├── sw-KE.js │ ├── syr-SY.js │ ├── ta-IN.js │ ├── te-IN.js │ ├── th-TH.js │ ├── tn-ZA.js │ ├── tr-TR.js │ ├── tt-RU.js │ ├── uk-UA.js │ ├── ur-PK.js │ ├── uz-Cyrl-UZ.js │ ├── uz-Latn-UZ.js │ ├── vi-VN.js │ ├── xh-ZA.js │ ├── zh-CN.js │ ├── zh-HK.js │ ├── zh-MO.js │ ├── zh-SG.js │ ├── zh-TW.js │ └── zu-ZA.js ├── parser.js ├── sugarpak.js └── time.js └── test ├── core ├── index.html ├── index.js └── jasmine.html ├── culture_info ├── index.html └── index.js ├── date ├── index.html └── index.js ├── date2 ├── date2.js └── index.html ├── date_and_time ├── index.html └── index.js ├── date_math ├── index.html └── index.js ├── dst ├── index.html └── index.js ├── images ├── accept.png ├── exclamation.png └── information.png ├── index.html ├── jQuery ├── datepicker.css ├── datepicker.html ├── datepicker.js └── datepicker_datejs.js ├── jasmine ├── MIT.LICENSE ├── SpecRunner.html ├── lib │ └── jasmine-2.3.4 │ │ ├── boot.js │ │ ├── console.js │ │ ├── jasmine-html.js │ │ ├── jasmine.css │ │ ├── jasmine.js │ │ └── jasmine_favicon.png ├── spec │ ├── PlayerSpec.js │ └── SpecHelper.js └── src │ ├── Player.js │ └── Song.js ├── parseExact ├── index.html └── index.js ├── partial ├── index.html └── index.js ├── performance ├── bulk.css ├── index.html └── index.js ├── relative ├── index.html └── index.js ├── relative_date_and_time ├── index.html └── index.js ├── rememberthemilk ├── index.html └── index.js ├── ruby_chronic ├── index.html └── index.js ├── scripts ├── Date_Ext.js ├── cruiser.js ├── date-functions.js ├── debugging.js ├── enumerable.js ├── firebug │ ├── errorIcon.png │ ├── firebug.css │ ├── firebug.html │ ├── firebug.js │ ├── firebugx.js │ ├── infoIcon.png │ └── warningIcon.png ├── jquery-1.2.1.pack.js ├── specification-converter.js ├── specifications.js └── specifications_original.js ├── styles ├── chart.css └── specifications.css ├── sugarpak ├── index.html ├── index.js └── jasmine.html ├── time ├── index.html └── index.js └── tostring ├── index.html └── index.js /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How To Contribute 2 | 3 | ## About Rights 4 | 5 | The Datejs project is [licensed](https://github.com/datejs/Datejs/blob/master/LICENSE) as [Apache v2.0 License](http://www.apache.org/licenses/LICENSE-2.0). If you provide any code to us and your code is added to Datejs, the code you provide will automatically inherit the same Apache License, Version 2.0. 6 | 7 | Your contribution will be subject to license’s Clause #5. 8 | 9 | > **5. Submission of Contributions.** Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 10 | 11 | ## Getting Started 12 | 13 | 1. Make sure you have a GitHub account 14 | 2. **IMPORTANT:** Start an [Issue](https://github.com/datejs/Datejs/issues): 15 | - Start the conversation regarding this defect or feature 16 | - Please provide a simplified code sample demonstrating how to reproduce the feature or issue 17 | - Clearly describe the issue, including steps to reproduce when it is a bug 18 | 3. Fork the repository on GitHub 19 | 20 | ## Forking 21 | 22 | You can fork our project from GitHub, develop/merge your feature or bugfix, then submit a Pull Request. Please keep in mind that: 23 | 24 | 1. Pull requests are actual commits with your modified code 25 | 2. One pull request must contain all commits related to that feature or bug fix (full changeset) 26 | 27 | ## Submitting Changes 28 | 29 | 1. **IMPORTANT:** Please read the [Contributor License Agreement](https://github.com/datejs/Datejs/blob/master/CLA.md) 30 | 2. **IMPORTANT:** Complete the [Contributor License Agreement Form](http://goo.gl/forms/2NxnVYI3tK) 31 | 3. Push your changes to a branch in your fork of the repository 32 | 4. Submit a Pull Request 33 | 5. Reference your Issue number in your Pull Request comments 34 | 35 | Your Pull Request will be reviewed. We will analyze your change and if it fits the coding standards and feature demand, we’ll add it to the main project. 36 | 37 | ## My Feature Is Awesome! Why don't you add it now? 38 | 39 | Some features or fixes might be brilliant additions, but break backwards compatibility. We may consider a change ineligible for immediate merging if it turns the project too far away from our current release plan. 40 | 41 | Not to worry, we will try our best to add your contribution into our next release! 42 | 43 | ## Bug Or Feature? 44 | 45 | If we still have a bug lurking around we will do our best to fix it promptly. 46 | 47 | Bug fixes are much more likely to be accepted in a short term than entirely new features that might compromise other parts of Datejs or developer experience. 48 | 49 | ## Will I Get Paid For Bugs Or Features? 50 | 51 | Your reward is sweet karma and that warm fuzzy feeling knowing you’ve helped the open source Datejs community. 52 | 53 | ## Additional Resources 54 | 55 | 1. [Contributor License Agreement](https://github.com/datejs/Datejs/blob/master/CLA.md) 56 | 2. [Issue tracker](https://github.com/datejs/Datejs/issues) 57 | 3. [Datejs Blog](https://datejs.comblog/) 58 | 5. [StackOverflow](https://stackoverflow.com/questions/tagged/datejs) 59 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008-2015 Object.NET, Inc. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Contact: 16 | https://object.net 17 | hello@object.net 18 | +1(888)775-5888 -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | ## TODO 2 | 3 | 1. More work to be done on Timezone, Timezone offsets and DST (Summer Time) 4 | 2. Add `.getFriendly()` to TimeSpan and TimePeriod. 5 | 6 | If a date was 3 days and 5 hours away from now, the TimeSpan `getFriendly()` function would return the following. 7 | 8 | ```javascript 9 | var future = new Date().add({days: 3, hours: 5}); 10 | var ts = new TimeSpan(future - new Date()); 11 | 12 | console.log(ts.getFriendly()); // "3 days and 5 hours from now" 13 | ``` 14 | 3. More tests! 15 | 16 | ## CUTTING ROOM FLOOR 17 | 18 | The following items were at one time tested for inclusion into the library, but were cut. They are documented here for reference. 19 | 20 | 1. Removed `Date.now()` because of potential collision with the future ECMA 4 spec, which will include a `Date.now()` function. 21 | 2. Removed `Date.getDayName(dayOfWeek)`. Please use `Date.CultureInfo.dayNames[dayOfWeek]`. 22 | 3. Removed `Date.getMonthName(month)`. Please use `Date.CultureInfo.monthNames[month]`. 23 | 4. `Date.prototype.getQuarter()` 24 | ```javascript 25 | /** 26 | * Get the Year Quarter number for the currect date instance. 27 | * @return {Number} 1 to 4 28 | */ 29 | $P.getQuarter = function () { 30 | return Math.ceil((this.getMonth() + 1)/3); 31 | }; 32 | ``` 33 | 5. `Date.isDate()`, Please use `instanceof`. 34 | ```javascript 35 | var d1 = null; 36 | d1 = Date.today(); 37 | console.log(d1 instanceof Date); 38 | ``` 39 | ```javascript 40 | /** 41 | * Determines if an object is a Date object. 42 | * @return {Boolean} true if object is a Date, otherwise false. 43 | */ 44 | $D.isDate = function (obj) { 45 | return (obj instanceof Date); 46 | }; 47 | ``` 48 | Another Version... 49 | ```javascript 50 | /** 51 | * Determines if an object is a Date object. 52 | * @return {Boolean} true if object is a Date, otherwise false. 53 | */ 54 | $D.isDate = function (obj) { 55 | return (obj !== null) ? obj.constructor.toString().match(/Date/i) == "Date" : false; 56 | }; 57 | ``` -------------------------------------------------------------------------------- /build/extras.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @version: 1.0 Alpha-1 3 | * @author: Coolite Inc. http://www.coolite.com/ 4 | * @date: 2008-05-13 5 | * @copyright: Copyright (c) 2006-2008, Coolite Inc. (http://www.coolite.com/). All rights reserved. 6 | * @license: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/. 7 | * @website: http://www.datejs.com/ 8 | */ 9 | (function(){var $D=Date,$P=$D.prototype,$C=$D.CultureInfo,$f=[],p=function(s,l){if(!l){l=2;} 10 | return("000"+s).slice(l*-1);};$D.normalizeFormat=function(format){$f=[];var t=new Date().$format(format);return $f.join("");};$D.strftime=function(format,time){return new Date(time*1000).$format(format);};$D.strtotime=function(time){var d=$D.parse(time);d.addMinutes(d.getTimezoneOffset()*-1);return Math.round($D.UTC(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate(),d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds())/1000);};$P.$format=function(format){var x=this,y,t=function(v){$f.push(v);return x.toString(v);};return format?format.replace(/(%|\\)?.|%%/g,function(m){if(m.charAt(0)==="\\"||m.substring(0,2)==="%%"){return m.replace("\\","").replace("%%","%");} 11 | switch(m){case"d":case"%d":return t("dd");case"D":case"%a":return t("ddd");case"j":case"%e":return t("d");case"l":case"%A":return t("dddd");case"N":case"%u":return x.getDay()+1;case"S":return t("S");case"w":case"%w":return x.getDay();case"z":return x.getOrdinalNumber();case"%j":return p(x.getOrdinalNumber(),3);case"%U":var d1=x.clone().set({month:0,day:1}).addDays(-1).moveToDayOfWeek(0),d2=x.clone().addDays(1).moveToDayOfWeek(0,-1);return(d2temp){throw new RangeError($D.getDayName(n)+" does not occur "+ntemp+" times in the month of "+$D.getMonthName(temp.getMonth())+" "+temp.getFullYear()+".");} 14 | return this;} 15 | return this.moveToDayOfWeek(n,this._orient);};};var sdf=function(n){return function(){var t=$D.today(),shift=n-t.getDay();if(n===0&&$C.firstDayOfWeek===1&&t.getDay()!==0){shift=shift+7;} 16 | return t.addDays(shift);};};for(var i=0;i-1;m--){v=px[m].toLowerCase();if(o1[v]!=o2[v]){return false;} 21 | if(k==v){break;}} 22 | return true;} 23 | if(j.substring(j.length-1)!="s"){j+="s";} 24 | return this["add"+j](this._orient);};};var nf=function(n){return function(){this._dateElement=n;return this;};};for(var k=0;kt2)?1:0;};this.equals=function(time){return(this.compareTo(time)===0);};this.add=function(time){return(time===null)?this:this.addSeconds(time.getTotalMilliseconds()/1000);};this.subtract=function(time){return(time===null)?this:this.addSeconds(-time.getTotalMilliseconds()/1000);};this.addDays=function(n){return new TimeSpan(this.getTotalMilliseconds()+(n*86400000));};this.addHours=function(n){return new TimeSpan(this.getTotalMilliseconds()+(n*3600000));};this.addMinutes=function(n){return new TimeSpan(this.getTotalMilliseconds()+(n*60000));};this.addSeconds=function(n){return new TimeSpan(this.getTotalMilliseconds()+(n*1000));};this.addMilliseconds=function(n){return new TimeSpan(this.getTotalMilliseconds()+n);};this.get12HourHour=function(){return(this.getHours()>12)?this.getHours()-12:(this.getHours()===0)?12:this.getHours();};this.getDesignator=function(){return(this.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;};this.toString=function(format){this._toString=function(){if(this.getDays()!==null&&this.getDays()>0){return this.getDays()+"."+this.getHours()+":"+this.p(this.getMinutes())+":"+this.p(this.getSeconds());} 14 | else{return this.getHours()+":"+this.p(this.getMinutes())+":"+this.p(this.getSeconds());}};this.p=function(s){return(s.toString().length<2)?"0"+s:s;};var me=this;return format?format.replace(/dd?|HH?|hh?|mm?|ss?|tt?/g,function(format){switch(format){case"d":return me.getDays();case"dd":return me.p(me.getDays());case"H":return me.getHours();case"HH":return me.p(me.getHours());case"h":return me.get12HourHour();case"hh":return me.p(me.get12HourHour());case"m":return me.getMinutes();case"mm":return me.p(me.getMinutes());case"s":return me.getSeconds();case"ss":return me.p(me.getSeconds());case"t":return((me.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator).substring(0,1);case"tt":return(me.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;}}):this._toString();};return this;};Date.prototype.getTimeOfDay=function(){return new TimeSpan(0,this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds());};var TimePeriod=function(years,months,days,hours,minutes,seconds,milliseconds){var attrs="years months days hours minutes seconds milliseconds".split(/\s+/);var gFn=function(attr){return function(){return this[attr];};};var sFn=function(attr){return function(val){this[attr]=val;return this;};};for(var i=0;id2)?-1:+1;this.years=d2.getFullYear()-d1.getFullYear();temp.addYears(this.years);if(orient==+1){if(temp>d2){if(this.years!==0){this.years--;}}}else{if(tempd2&&d1.clone().addDays(-d1.getDaysInMonth())>d2){d1.addMonths(-1);this.months--;}} 18 | var diff=d2-d1;if(diff!==0){var ts=new TimeSpan(diff);this.setDays(ts.getDays());this.setHours(ts.getHours());this.setMinutes(ts.getMinutes());this.setSeconds(ts.getSeconds());this.setMilliseconds(ts.getMilliseconds());}} 19 | return this;}; 20 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var gulp = require('gulp'); 3 | var jasmine = require('gulp-jasmine'); 4 | var uglify = require('gulp-uglify'); 5 | var concat = require('gulp-concat'); 6 | var sourcemaps = require('gulp-sourcemaps'); 7 | var runSequence = require('run-sequence'); 8 | var merge = require('merge-stream'); 9 | 10 | var gloablizationDir = 'src/globalization/'; 11 | var basefiles = ['src/core.js','src/sugarpak.js','src/parser.js','src/time.js']; 12 | var corefiles = [gloablizationDir+'en-US.js'].concat(basefiles); 13 | var globalizationFiles = fs.readdirSync(gloablizationDir); 14 | 15 | var coretests = [ 16 | 'test/core/index.js', 17 | 'test/date/index.js', 18 | 'test/date_and_time/index.js', 19 | 'test/date_math/index.js', 20 | 'test/dst/index.js', 21 | 'test/parseExact/index.js', 22 | 'test/partial/index.js', 23 | 'test/relative/index.js', 24 | 'test/relative_date_and_time/index.js', 25 | 'test/time/index.js', 26 | 'test/tostring/index.js' 27 | ]; 28 | 29 | var extendedtests = [ 30 | 'test/rememberthemilk/index.js', 31 | 'test/ruby_chronic/index.js', 32 | 'test/sugarpak/index.js', 33 | ]; 34 | 35 | 36 | gulp.task('coretest', function() { 37 | return gulp.src(corefiles.concat(coretests)) 38 | .pipe(jasmine()); 39 | }); 40 | 41 | gulp.task('extendedtest', function() { 42 | return gulp.src(corefiles.concat(extendedtests)) 43 | .pipe(jasmine()); 44 | }); 45 | 46 | gulp.task('buildCore', ['coretest'], function() { 47 | return gulp.src(corefiles) 48 | .pipe(sourcemaps.init()) 49 | .pipe(concat('date.js')) 50 | .pipe(uglify()) 51 | .pipe(sourcemaps.write('./')) 52 | .pipe(gulp.dest('./build')) 53 | }); 54 | 55 | gulp.task('buildGlobal', ['coretest'], function() { 56 | var tasks = globalizationFiles.map(function(culture){ 57 | var files = [gloablizationDir + culture].concat(basefiles); 58 | return pipeline(files, culture); 59 | }); 60 | 61 | return merge(tasks); 62 | }); 63 | 64 | function pipeline(files, culture) { 65 | return gulp.src(files) 66 | // .pipe(sourcemaps.init()) 67 | .pipe(concat(culture ? 'date-'+culture : 'date.js')) 68 | // .pipe(uglify()) 69 | // .pipe(sourcemaps.write('./')) 70 | .pipe(gulp.dest('./build')) 71 | } 72 | 73 | gulp.task('test', function() { 74 | runSequence(['coretest'],['extendedtest']); 75 | }); 76 | 77 | 78 | 79 | 80 | gulp.task('default', ['buildCore','buildGlobal']); 81 | 82 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Datejs", 3 | "version": "1.0.0", 4 | "description": "A Date library for browsers", 5 | "main": "build/date.js", 6 | "devDependencies": { 7 | "gulp": "^4.0.2", 8 | "gulp-jasmine": "^4.0.0", 9 | "gulp-concat": "^2.5.2", 10 | "gulp-sourcemaps": "^2.6.5", 11 | "gulp-uglify": "^3.0.2", 12 | "run-sequence": "^2.2.1", 13 | "merge-stream": "^2.0.0" 14 | }, 15 | "author": "", 16 | "license": "Apache 2.0" 17 | } 18 | -------------------------------------------------------------------------------- /src/date.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Please include a date.js file from the /build/ folder. 3 | * 4 | * Individual date.js files have been compiled for each of the 150+ supported Cultures. 5 | * 6 | * Example 7 | * date.js // English (United States) 8 | * date-en-US.js // English (United States) 9 | * date-de-DE.js // Deutsch (Deutschland) 10 | * date-es-MX.js // français (France) 11 | */ 12 | 13 | alert( 14 | "Please include a date.js file from the /build/ folder.\n\n" + 15 | "Individual date.js files have been compiled for each of the 150+ supported Cultures.\n\n" + 16 | "Example\n" + 17 | " date.js // English (United States)\n" + 18 | " date-en-US.js // English (United States)\n" + 19 | " date-de-DE.js // Deutsch (Deutschland)\n" + 20 | " date-es-MX.js // français (France)\n" 21 | ); -------------------------------------------------------------------------------- /src/globalization/ar-AE.js: -------------------------------------------------------------------------------- 1 | Date.CultureInfo = { 2 | /* Culture Name */ 3 | name: "ar-AE", 4 | englishName: "Arabic (U.A.E.)", 5 | nativeName: "العربية (الإمارات العربية المتحدة)", 6 | 7 | /* Day Name Strings */ 8 | dayNames: ["الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"], 9 | abbreviatedDayNames: ["أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"], 10 | shortestDayNames: ["حد", "ثن", "ثل", "رع", "خم", "جم", "سب"], 11 | firstLetterDayNames: ["ح", "ن", "ث", "ر", "خ", "ج", "س"], 12 | 13 | /* Month Name Strings */ 14 | monthNames: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"], 15 | abbreviatedMonthNames: ["ينا", "فبر", "مار", "أبر", "ماي", "يون", "يول", "أغس", "سبت", "أكت", "نوف", "ديس"], 16 | 17 | /* AM/PM Designators */ 18 | amDesignator: "ص", 19 | pmDesignator: "م", 20 | 21 | firstDayOfWeek: 7, 22 | twoDigitYearMax: 2029, 23 | 24 | /** 25 | * The dateElementOrder is based on the order of the 26 | * format specifiers in the formatPatterns.DatePattern. 27 | * 28 | * Example: 29 |
 30 |      shortDatePattern    dateElementOrder
 31 |      ------------------  ---------------- 
 32 |      "M/d/yyyy"          "mdy"
 33 |      "dd/MM/yyyy"        "dmy"
 34 |      "yyyy-MM-dd"        "ymd"
 35 |      
36 | * 37 | * The correct dateElementOrder is required by the parser to 38 | * determine the expected order of the date elements in the 39 | * string being parsed. 40 | */ 41 | dateElementOrder: "dmy", 42 | 43 | /* Standard date and time format patterns */ 44 | formatPatterns: { 45 | shortDate: "dd/MM/yy", 46 | longDate: "dd/MMMM/yyyy", 47 | shortTime: "hh:mm tt", 48 | longTime: "hh:mm:ss tt", 49 | fullDateTime: "dd/MMMM/yyyy hh:mm:ss tt", 50 | sortableDateTime: "yyyy-MM-ddTHH:mm:ss", 51 | universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ", 52 | rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT", 53 | monthDay: "dd MMMM", 54 | yearMonth: "MMMM, yyyy" 55 | }, 56 | 57 | /** 58 | * NOTE: If a string format is not parsing correctly, but 59 | * you would expect it parse, the problem likely lies below. 60 | * 61 | * The following regex patterns control most of the string matching 62 | * within the parser. 63 | * 64 | * The Month name and Day name patterns were automatically generated 65 | * and in general should be (mostly) correct. 66 | * 67 | * Beyond the month and day name patterns are natural language strings. 68 | * Example: "next", "today", "months" 69 | * 70 | * These natural language string may NOT be correct for this culture. 71 | * If they are not correct, please translate and edit this file 72 | * providing the correct regular expression pattern. 73 | * 74 | * If you modify this file, please post your revised CultureInfo file 75 | * to the Datejs Forum located at http://www.datejs.com/forums/. 76 | * 77 | * Please mark the subject of the post with [CultureInfo]. Example: 78 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark) 79 | * 80 | * We will add the modified patterns to the master source files. 81 | * 82 | * As well, please review the list of "Future Strings" section below. 83 | */ 84 | regexPatterns: { 85 | jan: /^ينا(ير)?/i, 86 | feb: /^فبر(اير)?/i, 87 | mar: /^مار(س)?/i, 88 | apr: /^أبر(يل)?/i, 89 | may: /^ماي(و)?/i, 90 | jun: /^يون(يو)?/i, 91 | jul: /^يول(يو)?/i, 92 | aug: /^أغس(طس)?/i, 93 | sep: /^سبت(مبر)?/i, 94 | oct: /^أكت(وبر)?/i, 95 | nov: /^نوف(مبر)?/i, 96 | dec: /^ديس(مبر)?/i, 97 | 98 | sun: /^الأحد|(أ|ا)حد|ح(د)?/i, 99 | mon: /^الإثنين|(إ|ا)ثنين|(ث)?ن/i, 100 | tue: /^الثلاثاء|ث(ل|لاثاء)?/i, 101 | wed: /^الأربعاء|(أ|ا)ربعاء|ر(ع)?/i, 102 | thu: /^الخميس|خ(م|ميس)?/i, 103 | fri: /^الجمعة|ج(م|معة)?/i, 104 | sat: /^السبت|س(ب|بت)?/i, 105 | 106 | future: /^القادم/i, 107 | past: /^الماضي/i, 108 | add: /^(\+|بعد|عقب)/i, 109 | subtract: /^(\-|قبل|منذ)/i, 110 | 111 | yesterday: /^((ال)?(ا|أ)مس|(ال)?بارح(ة)?)/i, 112 | today: /^اليوم/i, 113 | tomorrow: /^(الغد|غد(ا)?)/i, 114 | now: /^(ال)?آن/i, 115 | 116 | millisecond: /^(ال)?ج(زء(ا))?( من( ال(أ|ا)لف من)? |( )?.( )?)(ال)?ث(انية)?(.)?/i, 117 | second: /^(ال)?ث(انية|وان(ي)?)?(.)?/i, 118 | minute: /^(ال)?د(قيقة|قائق)?(.)?/i, 119 | hour: /^(ال)?س(اعة|اعات)?(.)?/i, 120 | week: /^(ال)?(إ|ا)س(بوع|ابيع)/i, 121 | month: /^(ال)?((أ|ا)?شهر|شهور)/i, 122 | day: /(ال)?(يوم|أيام)/i, 123 | year: /^(ال)?سن(ة|ين|ون|وات)/i, 124 | 125 | shortMeridian: /^(ص|م)/i, 126 | longMeridian: /^(صباح(ا)?|مساء(ا)?)/i, 127 | timezone: /^(((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc|((ب)?توقيت )?(الخليج|gst|gulf (standard)? tim(e|ing)))/i, 128 | ordinalSuffix: /^\s*(st|nd|rd|th)/i, 129 | timeContext: /^\s*(\:|a(?!u|p)|p)/i 130 | }, 131 | 132 | timezones: [{name:"UTC", offset:"+000"}, {name:"GMT", offset:"+000"}, {name:"GST", offset:"+0400"}] 133 | }; 134 | 135 | /******************** 136 | ** Future Strings ** 137 | ******************** 138 | * 139 | * The following list of strings may not be currently being used, but 140 | * may be incorporated into the Datejs library later. 141 | * 142 | * We would appreciate any help translating the strings below. 143 | * 144 | * If you modify this file, please post your revised CultureInfo file 145 | * to the Datejs Forum located at http://www.datejs.com/forums/. 146 | * 147 | * Please mark the subject of the post with [CultureInfo]. Example: 148 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark)b 149 | * 150 | * English Name Translated 151 | * ------------------ ----------------- 152 | * about قرابة 153 | * ago مضت 154 | * date التاريخ 155 | * time الوقت 156 | * calendar التقويم 157 | * show اظهار 158 | * hourly كل ساعة 159 | * daily يومياً 160 | * weekly اسبوعياً 161 | * bi-weekly مرتين بالإسبوع 162 | * fortnight اسبوعان 163 | * monthly شهرياً 164 | * bi-monthly مرتين بالشهر 165 | * quarter ربع 166 | * quarterly كل ربع سنة 167 | * yearly سنوياً 168 | * annual سنوي 169 | * annually سنوياً 170 | * annum عام 171 | * again مرة أخرى 172 | * between بين 173 | * after بعد 174 | * from now من الآن 175 | * repeat كرر 176 | * times مرات 177 | * per كل 178 | * min (abbrev minute) د. 179 | * morning صباح 180 | * noon ظهيرة 181 | * night ليل 182 | * midnight نصف الليل 183 | * mid-night نصف الليل 184 | * evening مساء 185 | * final ختامي 186 | * future مستقبل 187 | * spring ربيع 188 | * summer صيف 189 | * fall خريف 190 | * winter شتاء 191 | * end of نهاية 192 | * end نهاية 193 | * long طويل 194 | * short قصير 195 | */ 196 | -------------------------------------------------------------------------------- /src/globalization/ar-OM.js: -------------------------------------------------------------------------------- 1 | Date.CultureInfo = { 2 | /* Culture Name */ 3 | name: "ar-OM", 4 | englishName: "Arabic (Oman)", 5 | nativeName: "العربية (عمان)", 6 | 7 | /* Day Name Strings */ 8 | dayNames: ["الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"], 9 | abbreviatedDayNames: ["أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"], 10 | shortestDayNames: ["حد", "ثن", "ثل", "رع", "خم", "جم", "سب"], 11 | firstLetterDayNames: ["ح", "ن", "ث", "ر", "خ", "ج", "س"], 12 | 13 | /* Month Name Strings */ 14 | monthNames: ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"], 15 | abbreviatedMonthNames: ["ينا", "فبر", "مار", "أبر", "ماي", "يون", "يول", "أغس", "سبت", "أكت", "نوف", "ديس"], 16 | 17 | /* AM/PM Designators */ 18 | amDesignator: "ص", 19 | pmDesignator: "م", 20 | 21 | firstDayOfWeek: 7, 22 | twoDigitYearMax: 2029, 23 | 24 | /** 25 | * The dateElementOrder is based on the order of the 26 | * format specifiers in the formatPatterns.DatePattern. 27 | * 28 | * Example: 29 |
 30 |      shortDatePattern    dateElementOrder
 31 |      ------------------  ---------------- 
 32 |      "M/d/yyyy"          "mdy"
 33 |      "dd/MM/yyyy"        "dmy"
 34 |      "yyyy-MM-dd"        "ymd"
 35 |      
36 | * 37 | * The correct dateElementOrder is required by the parser to 38 | * determine the expected order of the date elements in the 39 | * string being parsed. 40 | */ 41 | dateElementOrder: "dmy", 42 | 43 | /* Standard date and time format patterns */ 44 | formatPatterns: { 45 | shortDate: "dd/MM/yy", 46 | longDate: "dd/MMMM/yyyy", 47 | shortTime: "hh:mm tt", 48 | longTime: "hh:mm:ss tt", 49 | fullDateTime: "dd/MMMM/yyyy hh:mm:ss tt", 50 | sortableDateTime: "yyyy-MM-ddTHH:mm:ss", 51 | universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ", 52 | rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT", 53 | monthDay: "dd MMMM", 54 | yearMonth: "MMMM, yyyy" 55 | }, 56 | 57 | /** 58 | * NOTE: If a string format is not parsing correctly, but 59 | * you would expect it parse, the problem likely lies below. 60 | * 61 | * The following regex patterns control most of the string matching 62 | * within the parser. 63 | * 64 | * The Month name and Day name patterns were automatically generated 65 | * and in general should be (mostly) correct. 66 | * 67 | * Beyond the month and day name patterns are natural language strings. 68 | * Example: "next", "today", "months" 69 | * 70 | * These natural language string may NOT be correct for this culture. 71 | * If they are not correct, please translate and edit this file 72 | * providing the correct regular expression pattern. 73 | * 74 | * If you modify this file, please post your revised CultureInfo file 75 | * to the Datejs Forum located at http://www.datejs.com/forums/. 76 | * 77 | * Please mark the subject of the post with [CultureInfo]. Example: 78 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark) 79 | * 80 | * We will add the modified patterns to the master source files. 81 | * 82 | * As well, please review the list of "Future Strings" section below. 83 | */ 84 | regexPatterns: { 85 | jan: /^ينا(ير)?/i, 86 | feb: /^فبر(اير)?/i, 87 | mar: /^مار(س)?/i, 88 | apr: /^أبر(يل)?/i, 89 | may: /^ماي(و)?/i, 90 | jun: /^يون(يو)?/i, 91 | jul: /^يول(يو)?/i, 92 | aug: /^أغس(طس)?/i, 93 | sep: /^سبت(مبر)?/i, 94 | oct: /^أكت(وبر)?/i, 95 | nov: /^نوف(مبر)?/i, 96 | dec: /^ديس(مبر)?/i, 97 | 98 | sun: /^الأحد|(أ|ا)حد|ح(د)?/i, 99 | mon: /^الإثنين|(إ|ا)ثنين|(ث)?ن/i, 100 | tue: /^الثلاثاء|ث(ل|لاثاء)?/i, 101 | wed: /^الأربعاء|(أ|ا)ربعاء|ر(ع)?/i, 102 | thu: /^الخميس|خ(م|ميس)?/i, 103 | fri: /^الجمعة|ج(م|معة)?/i, 104 | sat: /^السبت|س(ب|بت)?/i, 105 | 106 | future: /^القادم/i, 107 | past: /^الماضي/i, 108 | add: /^(\+|بعد|عقب)/i, 109 | subtract: /^(\-|قبل|منذ)/i, 110 | 111 | yesterday: /^((ال)?(ا|أ)مس|(ال)?بارح(ة)?)/i, 112 | today: /^اليوم/i, 113 | tomorrow: /^(الغد|غد(ا)?)/i, 114 | now: /^(ال)?آن/i, 115 | 116 | millisecond: /^(ال)?ج(زء(ا))?( من( ال(أ|ا)لف من)? |( )?.( )?)(ال)?ث(انية)?(.)?/i, 117 | second: /^(ال)?ث(انية|وان(ي)?)?(.)?/i, 118 | minute: /^(ال)?د(قيقة|قائق)?(.)?/i, 119 | hour: /^(ال)?س(اعة|اعات)?(.)?/i, 120 | week: /^(ال)?(إ|ا)س(بوع|ابيع)/i, 121 | month: /^(ال)?((أ|ا)?شهر|شهور)/i, 122 | day: /(ال)?(يوم|أيام)/i, 123 | year: /^(ال)?سن(ة|ين|ون|وات)/i, 124 | 125 | shortMeridian: /^(ص|م)/i, 126 | longMeridian: /^(صباح(ا)?|مساء(ا)?)/i, 127 | timezone: /^(((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc|((ب)?توقيت )?(الخليج|gst|gulf (standard)? tim(e|ing)))/i, 128 | ordinalSuffix: /^\s*(st|nd|rd|th)/i, 129 | timeContext: /^\s*(\:|a(?!u|p)|p)/i 130 | }, 131 | 132 | timezones: [{name:"UTC", offset:"+000"}, {name:"GMT", offset:"+000"}, {name:"GST", offset:"+0400"}] 133 | }; 134 | 135 | /******************** 136 | ** Future Strings ** 137 | ******************** 138 | * 139 | * The following list of strings may not be currently being used, but 140 | * may be incorporated into the Datejs library later. 141 | * 142 | * We would appreciate any help translating the strings below. 143 | * 144 | * If you modify this file, please post your revised CultureInfo file 145 | * to the Datejs Forum located at http://www.datejs.com/forums/. 146 | * 147 | * Please mark the subject of the post with [CultureInfo]. Example: 148 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark)b 149 | * 150 | * English Name Translated 151 | * ------------------ ----------------- 152 | * about قرابة 153 | * ago مضت 154 | * date التاريخ 155 | * time الوقت 156 | * calendar التقويم 157 | * show اظهار 158 | * hourly كل ساعة 159 | * daily يومياً 160 | * weekly اسبوعياً 161 | * bi-weekly مرتين بالإسبوع 162 | * fortnight اسبوعان 163 | * monthly شهرياً 164 | * bi-monthly مرتين بالشهر 165 | * quarter ربع 166 | * quarterly كل ربع سنة 167 | * yearly سنوياً 168 | * annual سنوي 169 | * annually سنوياً 170 | * annum عام 171 | * again مرة أخرى 172 | * between بين 173 | * after بعد 174 | * from now من الآن 175 | * repeat كرر 176 | * times مرات 177 | * per كل 178 | * min (abbrev minute) د. 179 | * morning صباح 180 | * noon ظهيرة 181 | * night ليل 182 | * midnight نصف الليل 183 | * mid-night نصف الليل 184 | * evening مساء 185 | * final ختامي 186 | * future مستقبل 187 | * spring ربيع 188 | * summer صيف 189 | * fall خريف 190 | * winter شتاء 191 | * end of نهاية 192 | * end نهاية 193 | * long طويل 194 | * short قصير 195 | */ 196 | -------------------------------------------------------------------------------- /src/globalization/cs-CZ.js: -------------------------------------------------------------------------------- 1 | Date.CultureInfo = { 2 | /* Culture Name */ 3 | name: "cs-CZ", 4 | englishName: "Czech (Czech Republic)", 5 | nativeName: "čeština (Česká republika)", 6 | 7 | /* Day Name Strings */ 8 | dayNames: ["neděle", "pondělí", "úterý", "středa", "čtvrtek", "pátek", "sobota"], 9 | abbreviatedDayNames: ["ne", "po", "út", "st", "čt", "pá", "so"], 10 | shortestDayNames: ["ne", "po", "út", "st", "čt", "pá", "so"], 11 | firstLetterDayNames: ["n", "p", "ú", "s", "č", "p", "s"], 12 | 13 | /* Month Name Strings */ 14 | monthNames: ["leden", "únor", "březen", "duben", "květen", "červen", "červenec", "srpen", "září", "říjen", "listopad", "prosinec"], 15 | abbreviatedMonthNames: ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"], 16 | 17 | /* AM/PM Designators */ 18 | amDesignator: "dop.", 19 | pmDesignator: "odp.", 20 | 21 | firstDayOfWeek: 1, 22 | twoDigitYearMax: 2029, 23 | 24 | /** 25 | * The dateElementOrder is based on the order of the 26 | * format specifiers in the formatPatterns.DatePattern. 27 | * 28 | * Example: 29 |
 30 |      shortDatePattern    dateElementOrder
 31 |      ------------------  ---------------- 
 32 |      "M/d/yyyy"          "mdy"
 33 |      "dd/MM/yyyy"        "dmy"
 34 |      "yyyy-MM-dd"        "ymd"
 35 |      
36 | * 37 | * The correct dateElementOrder is required by the parser to 38 | * determine the expected order of the date elements in the 39 | * string being parsed. 40 | */ 41 | dateElementOrder: "dmy", 42 | 43 | /* Standard date and time format patterns */ 44 | formatPatterns: { 45 | shortDate: "d.M.yyyy", 46 | longDate: "d. MMMM yyyy", 47 | shortTime: "H:mm", 48 | longTime: "H:mm:ss", 49 | fullDateTime: "d. MMMM yyyy H:mm:ss", 50 | sortableDateTime: "yyyy-MM-ddTHH:mm:ss", 51 | universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ", 52 | rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT", 53 | monthDay: "dd MMMM", 54 | yearMonth: "MMMM yyyy" 55 | }, 56 | 57 | /** 58 | * NOTE: If a string format is not parsing correctly, but 59 | * you would expect it parse, the problem likely lies below. 60 | * 61 | * The following regex patterns control most of the string matching 62 | * within the parser. 63 | * 64 | * The Month name and Day name patterns were automatically generated 65 | * and in general should be (mostly) correct. 66 | * 67 | * Beyond the month and day name patterns are natural language strings. 68 | * Example: "next", "today", "months" 69 | * 70 | * These natural language string may NOT be correct for this culture. 71 | * If they are not correct, please translate and edit this file 72 | * providing the correct regular expression pattern. 73 | * 74 | * If you modify this file, please post your revised CultureInfo file 75 | * to the Datejs Forum located at http://www.datejs.com/forums/. 76 | * 77 | * Please mark the subject of the post with [CultureInfo]. Example: 78 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark) 79 | * 80 | * We will add the modified patterns to the master source files. 81 | * 82 | * As well, please review the list of "Future Strings" section below. 83 | */ 84 | regexPatterns: { 85 | jan: /^leden/i, 86 | feb: /^únor/i, 87 | mar: /^březen/i, 88 | apr: /^duben/i, 89 | may: /^květen/i, 90 | jun: /^červen/i, 91 | jul: /^červenec/i, 92 | aug: /^srpen/i, 93 | sep: /^září/i, 94 | oct: /^říjen/i, 95 | nov: /^listopad/i, 96 | dec: /^prosinec/i, 97 | 98 | sun: /^neděle/i, 99 | mon: /^pondělí/i, 100 | tue: /^úterý/i, 101 | wed: /^středa/i, 102 | thu: /^čtvrtek/i, 103 | fri: /^pátek/i, 104 | sat: /^sobota/i, 105 | 106 | future: /^next/i, 107 | past: /^last|past|prev(ious)?/i, 108 | add: /^(\+|aft(er)?|from|hence)/i, 109 | subtract: /^(\-|bef(ore)?|ago)/i, 110 | 111 | yesterday: /^yes(terday)?/i, 112 | today: /^t(od(ay)?)?/i, 113 | tomorrow: /^tom(orrow)?/i, 114 | now: /^n(ow)?/i, 115 | 116 | millisecond: /^ms|milli(second)?s?/i, 117 | second: /^sec(ond)?s?/i, 118 | minute: /^mn|min(ute)?s?/i, 119 | hour: /^h(our)?s?/i, 120 | week: /^w(eek)?s?/i, 121 | month: /^m(onth)?s?/i, 122 | day: /^d(ay)?s?/i, 123 | year: /^y(ear)?s?/i, 124 | 125 | shortMeridian: /^(a|p)/i, 126 | longMeridian: /^(a\.?m?\.?|p\.?m?\.?)/i, 127 | timezone: /^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i, 128 | ordinalSuffix: /^\s*(st|nd|rd|th)/i, 129 | timeContext: /^\s*(\:|a(?!u|p)|p)/i 130 | }, 131 | 132 | timezones: [{name:"UTC", offset:"-000"}, {name:"GMT", offset:"-000"}, {name:"EST", offset:"-0500"}, {name:"EDT", offset:"-0400"}, {name:"CST", offset:"-0600"}, {name:"CDT", offset:"-0500"}, {name:"MST", offset:"-0700"}, {name:"MDT", offset:"-0600"}, {name:"PST", offset:"-0800"}, {name:"PDT", offset:"-0700"}] 133 | }; 134 | 135 | /******************** 136 | ** Future Strings ** 137 | ******************** 138 | * 139 | * The following list of strings may not be currently being used, but 140 | * may be incorporated into the Datejs library later. 141 | * 142 | * We would appreciate any help translating the strings below. 143 | * 144 | * If you modify this file, please post your revised CultureInfo file 145 | * to the Datejs Forum located at http://www.datejs.com/forums/. 146 | * 147 | * Please mark the subject of the post with [CultureInfo]. Example: 148 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark)b 149 | * 150 | * English Name Translated 151 | * ------------------ ----------------- 152 | * about about 153 | * ago ago 154 | * date date 155 | * time time 156 | * calendar calendar 157 | * show show 158 | * hourly hourly 159 | * daily daily 160 | * weekly weekly 161 | * bi-weekly bi-weekly 162 | * fortnight fortnight 163 | * monthly monthly 164 | * bi-monthly bi-monthly 165 | * quarter quarter 166 | * quarterly quarterly 167 | * yearly yearly 168 | * annual annual 169 | * annually annually 170 | * annum annum 171 | * again again 172 | * between between 173 | * after after 174 | * from now from now 175 | * repeat repeat 176 | * times times 177 | * per per 178 | * min (abbrev minute) min 179 | * morning morning 180 | * noon noon 181 | * night night 182 | * midnight midnight 183 | * mid-night mid-night 184 | * evening evening 185 | * final final 186 | * future future 187 | * spring spring 188 | * summer summer 189 | * fall fall 190 | * winter winter 191 | * end of end of 192 | * end end 193 | * long long 194 | * short short 195 | */ -------------------------------------------------------------------------------- /src/globalization/fa-IR.js: -------------------------------------------------------------------------------- 1 | Date.CultureInfo = { 2 | /* Culture Name */ 3 | name: "fa-IR", 4 | englishName: "Persian (Iran)", 5 | nativeName: "فارسى (ايران)", 6 | 7 | /* Day Name Strings */ 8 | dayNames: ["یکشنبه", "دوشنبه", "سه شنبه", "چهار شنبه", "پنجشنبه", "جمعه", "یک"], 9 | abbreviatedDayNames: ["یکشنبه", "دو", "سه", "چهار", "پنج", "جمعه", "شنبه"], 10 | shortestDayNames: ["یک", "دو", "سه", "چه", "پن", "جم", "شن"], 11 | firstLetterDayNames: ["ی", "د", "س", "چ", "پ", "ج", "ش"], 12 | 13 | /* Month Name Strings */ 14 | monthNames: ["ژانویه", "فوریه", "مارس", "آوریل", "مه", "ژوئیه", "ژولای", "آگوست", "سپتامبر", "اکتبر", "نوامبر", "دسامبر"], 15 | abbreviatedMonthNames: ["ژان", "فور", "مار", "آور", "مه", "ژوئ", "ژول", "آگو", "سپت", "اکت", "نوا", "دسا"], 16 | 17 | /* AM/PM Designators */ 18 | amDesignator: "ق.ظ", 19 | pmDesignator: "ب.ظ", 20 | 21 | firstDayOfWeek: 0, 22 | twoDigitYearMax: 2029, 23 | 24 | /** 25 | * The dateElementOrder is based on the order of the 26 | * format specifiers in the formatPatterns.DatePattern. 27 | * 28 | * Example: 29 |
 30 |      shortDatePattern    dateElementOrder
 31 |      ------------------  ----------------
 32 |      "M/d/yyyy"          "mdy"
 33 |      "dd/MM/yyyy"        "dmy"
 34 |      "yyyy-MM-dd"        "ymd"
 35 |      
36 | * 37 | * The correct dateElementOrder is required by the parser to 38 | * determine the expected order of the date elements in the 39 | * string being parsed. 40 | */ 41 | dateElementOrder: "mdy", 42 | 43 | /* Standard date and time format patterns */ 44 | formatPatterns: { 45 | shortDate: "M/d/yyyy", 46 | longDate: "dddd, MMMM dd, yyyy", 47 | shortTime: "hh:mm tt", 48 | longTime: "hh:mm:ss tt", 49 | fullDateTime: "dddd, MMMM dd, yyyy hh:mm:ss tt", 50 | sortableDateTime: "yyyy-MM-ddTHH:mm:ss", 51 | universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ", 52 | rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT", 53 | monthDay: "MMMM dd", 54 | yearMonth: "MMMM, yyyy" 55 | }, 56 | 57 | /** 58 | * NOTE: If a string format is not parsing correctly, but 59 | * you would expect it parse, the problem likely lies below. 60 | * 61 | * The following regex patterns control most of the string matching 62 | * within the parser. 63 | * 64 | * The Month name and Day name patterns were automatically generated 65 | * and in general should be (mostly) correct. 66 | * 67 | * Beyond the month and day name patterns are natural language strings. 68 | * Example: "next", "today", "months" 69 | * 70 | * These natural language string may NOT be correct for this culture. 71 | * If they are not correct, please translate and edit this file 72 | * providing the correct regular expression pattern. 73 | * 74 | * If you modify this file, please post your revised CultureInfo file 75 | * to the Datejs Forum located at http://www.datejs.com/forums/. 76 | * 77 | * Please mark the subject of the post with [CultureInfo]. Example: 78 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark) 79 | * 80 | * We will add the modified patterns to the master source files. 81 | * 82 | * As well, please review the list of "Future Strings" section below. 83 | */ 84 | regexPatterns: { 85 | jan: /^ژانویه/i, 86 | feb: /^فوریه/i, 87 | mar: /^مارس/i, 88 | apr: /^آوریل/i, 89 | may: /^مه/i, 90 | jun: /^ژوئیه/i, 91 | jul: /^ژولای/i, 92 | aug: /^آگوست/i, 93 | sep: /^سپتامبر/i, 94 | oct: /^اکتبر/i, 95 | nov: /^سپتامبر/i, 96 | dec: /^دسامبر/i, 97 | 98 | sun: /^یکشنبه/i, 99 | mon: /^دوشنبه/i, 100 | tue: /^سه شنبه/i, 101 | wed: /^چهارشنبه/i, 102 | thu: /^پنجشنبه/i, 103 | fri: /^جمعه/i, 104 | sat: /^شنبه/i, 105 | 106 | future: /^next/i, 107 | past: /^last|past|prev(ious)?/i, 108 | add: /^(\+|aft(er)?|from|hence)/i, 109 | subtract: /^(\-|bef(ore)?|ago)/i, 110 | 111 | yesterday: /^yes(terday)?/i, 112 | today: /^t(od(ay)?)?/i, 113 | tomorrow: /^tom(orrow)?/i, 114 | now: /^n(ow)?/i, 115 | 116 | millisecond: /^ms|milli(second)?s?/i, 117 | second: /^sec(ond)?s?/i, 118 | minute: /^mn|min(ute)?s?/i, 119 | hour: /^h(our)?s?/i, 120 | week: /^w(eek)?s?/i, 121 | month: /^m(onth)?s?/i, 122 | day: /^d(ay)?s?/i, 123 | year: /^y(ear)?s?/i, 124 | 125 | shortMeridian: /^(a|p)/i, 126 | longMeridian: /^(a\.?m?\.?|p\.?m?\.?)/i, 127 | timezone: /^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i, 128 | ordinalSuffix: /^\s*(st|nd|rd|th)/i, 129 | timeContext: /^\s*(\:|a(?!u|p)|p)/i 130 | }, 131 | 132 | timezones: [{name:"UTC", offset:"-000"}, {name:"GMT", offset:"-000"}, {name:"EST", offset:"-0500"}, {name:"EDT", offset:"-0400"}, {name:"CST", offset:"-0600"}, {name:"CDT", offset:"-0500"}, {name:"MST", offset:"-0700"}, {name:"MDT", offset:"-0600"}, {name:"PST", offset:"-0800"}, {name:"PDT", offset:"-0700"}] 133 | }; 134 | 135 | /******************** 136 | ** Future Strings ** 137 | ******************** 138 | * 139 | * The following list of strings may not be currently being used, but 140 | * may be incorporated into the Datejs library later. 141 | * 142 | * We would appreciate any help translating the strings below. 143 | * 144 | * If you modify this file, please post your revised CultureInfo file 145 | * to the Datejs Forum located at http://www.datejs.com/forums/. 146 | * 147 | * Please mark the subject of the post with [CultureInfo]. Example: 148 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark)b 149 | * 150 | * English Name Translated 151 | * ------------------ ----------------- 152 | * about about 153 | * ago ago 154 | * date date 155 | * time time 156 | * calendar calendar 157 | * show show 158 | * hourly hourly 159 | * daily daily 160 | * weekly weekly 161 | * bi-weekly bi-weekly 162 | * fortnight fortnight 163 | * monthly monthly 164 | * bi-monthly bi-monthly 165 | * quarter quarter 166 | * quarterly quarterly 167 | * yearly yearly 168 | * annual annual 169 | * annually annually 170 | * annum annum 171 | * again again 172 | * between between 173 | * after after 174 | * from now from now 175 | * repeat repeat 176 | * times times 177 | * per per 178 | * min (abbrev minute) min 179 | * morning morning 180 | * noon noon 181 | * night night 182 | * midnight midnight 183 | * mid-night mid-night 184 | * evening evening 185 | * final final 186 | * future future 187 | * spring spring 188 | * summer summer 189 | * fall fall 190 | * winter winter 191 | * end of end of 192 | * end end 193 | * long long 194 | * short short 195 | */ 196 | -------------------------------------------------------------------------------- /src/globalization/ja-JP.js: -------------------------------------------------------------------------------- 1 | Date.CultureInfo = { 2 | /* Culture Name */ 3 | name: "ja-JP", 4 | englishName: "Japanese (Japan)", 5 | nativeName: "日本語 (日本)", 6 | 7 | /* Day Name Strings */ 8 | dayNames: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"], 9 | abbreviatedDayNames: ["日", "月", "火", "水", "木", "金", "土"], 10 | shortestDayNames: ["日", "月", "火", "水", "木", "金", "土"], 11 | firstLetterDayNames: ["日", "月", "火", "水", "木", "金", "土"], 12 | 13 | /* Month Name Strings */ 14 | monthNames: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], 15 | abbreviatedMonthNames: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], 16 | 17 | /* AM/PM Designators */ 18 | amDesignator: "午前", 19 | pmDesignator: "午後", 20 | 21 | firstDayOfWeek: 0, 22 | twoDigitYearMax: 2029, 23 | 24 | /** 25 | * The dateElementOrder is based on the order of the 26 | * format specifiers in the formatPatterns.DatePattern. 27 | * 28 | * Example: 29 |
 30 |      shortDatePattern    dateElementOrder
 31 |      ------------------  ---------------- 
 32 |      "M/d/yyyy"          "mdy"
 33 |      "dd/MM/yyyy"        "dmy"
 34 |      "yyyy-MM-dd"        "ymd"
 35 |      
36 | * 37 | * The correct dateElementOrder is required by the parser to 38 | * determine the expected order of the date elements in the 39 | * string being parsed. 40 | */ 41 | dateElementOrder: "ymd", 42 | 43 | /* Standard date and time format patterns */ 44 | formatPatterns: { 45 | shortDate: "yyyy/MM/dd", 46 | longDate: "yyyy'年'M'月'd'日'", 47 | shortTime: "H:mm", 48 | longTime: "H:mm:ss", 49 | fullDateTime: "yyyy'年'M'月'd'日' H:mm:ss", 50 | sortableDateTime: "yyyy-MM-ddTHH:mm:ss", 51 | universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ", 52 | rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT", 53 | monthDay: "M'月'd'日'", 54 | yearMonth: "yyyy'年'M'月'" 55 | }, 56 | 57 | /** 58 | * NOTE: If a string format is not parsing correctly, but 59 | * you would expect it parse, the problem likely lies below. 60 | * 61 | * The following regex patterns control most of the string matching 62 | * within the parser. 63 | * 64 | * The Month name and Day name patterns were automatically generated 65 | * and in general should be (mostly) correct. 66 | * 67 | * Beyond the month and day name patterns are natural language strings. 68 | * Example: "next", "today", "months" 69 | * 70 | * These natural language string may NOT be correct for this culture. 71 | * If they are not correct, please translate and edit this file 72 | * providing the correct regular expression pattern. 73 | * 74 | * If you modify this file, please post your revised CultureInfo file 75 | * to the Datejs Forum located at http://www.datejs.com/forums/. 76 | * 77 | * Please mark the subject of the post with [CultureInfo]. Example: 78 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark) 79 | * 80 | * We will add the modified patterns to the master source files. 81 | * 82 | * As well, please review the list of "Future Strings" section below. 83 | */ 84 | regexPatterns: { 85 | jan: /^1(月)?/i, 86 | feb: /^2(月)?/i, 87 | mar: /^3(月)?/i, 88 | apr: /^4(月)?/i, 89 | may: /^5(月)?/i, 90 | jun: /^6(月)?/i, 91 | jul: /^7(月)?/i, 92 | aug: /^8(月)?/i, 93 | sep: /^9(月)?/i, 94 | oct: /^10(月)?/i, 95 | nov: /^11(月)?/i, 96 | dec: /^12(月)?/i, 97 | 98 | sun: /^日曜日/i, 99 | mon: /^月曜日/i, 100 | tue: /^火曜日/i, 101 | wed: /^水曜日/i, 102 | thu: /^木曜日/i, 103 | fri: /^金曜日/i, 104 | sat: /^土曜日/i, 105 | 106 | future: /^next/i, 107 | past: /^last|past|prev(ious)?/i, 108 | add: /^(\+|aft(er)?|from|hence)/i, 109 | subtract: /^(\-|bef(ore)?|ago)/i, 110 | 111 | yesterday: /^yes(terday)?/i, 112 | today: /^t(od(ay)?)?/i, 113 | tomorrow: /^tom(orrow)?/i, 114 | now: /^n(ow)?/i, 115 | 116 | millisecond: /^ms|milli(second)?s?/i, 117 | second: /^sec(ond)?s?/i, 118 | minute: /^mn|min(ute)?s?/i, 119 | hour: /^h(our)?s?/i, 120 | week: /^w(eek)?s?/i, 121 | month: /^m(onth)?s?/i, 122 | day: /^d(ay)?s?/i, 123 | year: /^y(ear)?s?/i, 124 | 125 | shortMeridian: /^(a|p)/i, 126 | longMeridian: /^(a\.?m?\.?|p\.?m?\.?)/i, 127 | timezone: /^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i, 128 | ordinalSuffix: /^\s*(st|nd|rd|th)/i, 129 | timeContext: /^\s*(\:|a(?!u|p)|p)/i 130 | }, 131 | 132 | timezones: [{name:"UTC", offset:"-000"}, {name:"GMT", offset:"-000"}, {name:"EST", offset:"-0500"}, {name:"EDT", offset:"-0400"}, {name:"CST", offset:"-0600"}, {name:"CDT", offset:"-0500"}, {name:"MST", offset:"-0700"}, {name:"MDT", offset:"-0600"}, {name:"PST", offset:"-0800"}, {name:"PDT", offset:"-0700"}] 133 | }; 134 | 135 | /******************** 136 | ** Future Strings ** 137 | ******************** 138 | * 139 | * The following list of strings may not be currently being used, but 140 | * may be incorporated into the Datejs library later. 141 | * 142 | * We would appreciate any help translating the strings below. 143 | * 144 | * If you modify this file, please post your revised CultureInfo file 145 | * to the Datejs Forum located at http://www.datejs.com/forums/. 146 | * 147 | * Please mark the subject of the post with [CultureInfo]. Example: 148 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark)b 149 | * 150 | * English Name Translated 151 | * ------------------ ----------------- 152 | * about about 153 | * ago ago 154 | * date date 155 | * time time 156 | * calendar calendar 157 | * show show 158 | * hourly hourly 159 | * daily daily 160 | * weekly weekly 161 | * bi-weekly bi-weekly 162 | * fortnight fortnight 163 | * monthly monthly 164 | * bi-monthly bi-monthly 165 | * quarter quarter 166 | * quarterly quarterly 167 | * yearly yearly 168 | * annual annual 169 | * annually annually 170 | * annum annum 171 | * again again 172 | * between between 173 | * after after 174 | * from now from now 175 | * repeat repeat 176 | * times times 177 | * per per 178 | * min (abbrev minute) min 179 | * morning morning 180 | * noon noon 181 | * night night 182 | * midnight midnight 183 | * mid-night mid-night 184 | * evening evening 185 | * final final 186 | * future future 187 | * spring spring 188 | * summer summer 189 | * fall fall 190 | * winter winter 191 | * end of end of 192 | * end end 193 | * long long 194 | * short short 195 | */ -------------------------------------------------------------------------------- /src/globalization/ko-KR.js: -------------------------------------------------------------------------------- 1 | Date.CultureInfo = { 2 | /* Culture Name */ 3 | name: "ko-KR", 4 | englishName: "Korean (Korea)", 5 | nativeName: "한국어 (대한민국)", 6 | 7 | /* Day Name Strings */ 8 | dayNames: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"], 9 | abbreviatedDayNames: ["일", "월", "화", "수", "목", "금", "토"], 10 | shortestDayNames: ["일", "월", "화", "수", "목", "금", "토"], 11 | firstLetterDayNames: ["일", "월", "화", "수", "목", "금", "토"], 12 | 13 | /* Month Name Strings */ 14 | monthNames: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"], 15 | abbreviatedMonthNames: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], 16 | 17 | /* AM/PM Designators */ 18 | amDesignator: "오전", 19 | pmDesignator: "오후", 20 | 21 | firstDayOfWeek: 0, 22 | twoDigitYearMax: 2029, 23 | 24 | /** 25 | * The dateElementOrder is based on the order of the 26 | * format specifiers in the formatPatterns.DatePattern. 27 | * 28 | * Example: 29 |
 30 |      shortDatePattern    dateElementOrder
 31 |      ------------------  ---------------- 
 32 |      "M/d/yyyy"          "mdy"
 33 |      "dd/MM/yyyy"        "dmy"
 34 |      "yyyy-MM-dd"        "ymd"
 35 |      
36 | * 37 | * The correct dateElementOrder is required by the parser to 38 | * determine the expected order of the date elements in the 39 | * string being parsed. 40 | */ 41 | dateElementOrder: "ymd", 42 | 43 | /* Standard date and time format patterns */ 44 | formatPatterns: { 45 | shortDate: "yyyy-MM-dd", 46 | longDate: "yyyy'년' M'월' d'일' dddd", 47 | shortTime: "tt h:mm", 48 | longTime: "tt h:mm:ss", 49 | fullDateTime: "yyyy'년' M'월' d'일' dddd tt h:mm:ss", 50 | sortableDateTime: "yyyy-MM-ddTHH:mm:ss", 51 | universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ", 52 | rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT", 53 | monthDay: "M'월' d'일'", 54 | yearMonth: "yyyy'년' M'월'" 55 | }, 56 | 57 | /** 58 | * NOTE: If a string format is not parsing correctly, but 59 | * you would expect it parse, the problem likely lies below. 60 | * 61 | * The following regex patterns control most of the string matching 62 | * within the parser. 63 | * 64 | * The Month name and Day name patterns were automatically generated 65 | * and in general should be (mostly) correct. 66 | * 67 | * Beyond the month and day name patterns are natural language strings. 68 | * Example: "next", "today", "months" 69 | * 70 | * These natural language string may NOT be correct for this culture. 71 | * If they are not correct, please translate and edit this file 72 | * providing the correct regular expression pattern. 73 | * 74 | * If you modify this file, please post your revised CultureInfo file 75 | * to the Datejs Forum located at http://www.datejs.com/forums/. 76 | * 77 | * Please mark the subject of the post with [CultureInfo]. Example: 78 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark) 79 | * 80 | * We will add the modified patterns to the master source files. 81 | * 82 | * As well, please review the list of "Future Strings" section below. 83 | */ 84 | regexPatterns: { 85 | jan: /^1(월)?/i, 86 | feb: /^2(월)?/i, 87 | mar: /^3(월)?/i, 88 | apr: /^4(월)?/i, 89 | may: /^5(월)?/i, 90 | jun: /^6(월)?/i, 91 | jul: /^7(월)?/i, 92 | aug: /^8(월)?/i, 93 | sep: /^9(월)?/i, 94 | oct: /^10(월)?/i, 95 | nov: /^11(월)?/i, 96 | dec: /^12(월)?/i, 97 | 98 | sun: /^일요일/i, 99 | mon: /^월요일/i, 100 | tue: /^화요일/i, 101 | wed: /^수요일/i, 102 | thu: /^목요일/i, 103 | fri: /^금요일/i, 104 | sat: /^토요일/i, 105 | 106 | future: /^next/i, 107 | past: /^last|past|prev(ious)?/i, 108 | add: /^(\+|aft(er)?|from|hence)/i, 109 | subtract: /^(\-|bef(ore)?|ago)/i, 110 | 111 | yesterday: /^yes(terday)?/i, 112 | today: /^t(od(ay)?)?/i, 113 | tomorrow: /^tom(orrow)?/i, 114 | now: /^n(ow)?/i, 115 | 116 | millisecond: /^ms|milli(second)?s?/i, 117 | second: /^sec(ond)?s?/i, 118 | minute: /^mn|min(ute)?s?/i, 119 | hour: /^h(our)?s?/i, 120 | week: /^w(eek)?s?/i, 121 | month: /^m(onth)?s?/i, 122 | day: /^d(ay)?s?/i, 123 | year: /^y(ear)?s?/i, 124 | 125 | shortMeridian: /^(a|p)/i, 126 | longMeridian: /^(a\.?m?\.?|p\.?m?\.?)/i, 127 | timezone: /^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i, 128 | ordinalSuffix: /^\s*(st|nd|rd|th)/i, 129 | timeContext: /^\s*(\:|a(?!u|p)|p)/i 130 | }, 131 | 132 | timezones: [{name:"UTC", offset:"-000"}, {name:"GMT", offset:"-000"}, {name:"EST", offset:"-0500"}, {name:"EDT", offset:"-0400"}, {name:"CST", offset:"-0600"}, {name:"CDT", offset:"-0500"}, {name:"MST", offset:"-0700"}, {name:"MDT", offset:"-0600"}, {name:"PST", offset:"-0800"}, {name:"PDT", offset:"-0700"}] 133 | }; 134 | 135 | /******************** 136 | ** Future Strings ** 137 | ******************** 138 | * 139 | * The following list of strings may not be currently being used, but 140 | * may be incorporated into the Datejs library later. 141 | * 142 | * We would appreciate any help translating the strings below. 143 | * 144 | * If you modify this file, please post your revised CultureInfo file 145 | * to the Datejs Forum located at http://www.datejs.com/forums/. 146 | * 147 | * Please mark the subject of the post with [CultureInfo]. Example: 148 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark)b 149 | * 150 | * English Name Translated 151 | * ------------------ ----------------- 152 | * about about 153 | * ago ago 154 | * date date 155 | * time time 156 | * calendar calendar 157 | * show show 158 | * hourly hourly 159 | * daily daily 160 | * weekly weekly 161 | * bi-weekly bi-weekly 162 | * fortnight fortnight 163 | * monthly monthly 164 | * bi-monthly bi-monthly 165 | * quarter quarter 166 | * quarterly quarterly 167 | * yearly yearly 168 | * annual annual 169 | * annually annually 170 | * annum annum 171 | * again again 172 | * between between 173 | * after after 174 | * from now from now 175 | * repeat repeat 176 | * times times 177 | * per per 178 | * min (abbrev minute) min 179 | * morning morning 180 | * noon noon 181 | * night night 182 | * midnight midnight 183 | * mid-night mid-night 184 | * evening evening 185 | * final final 186 | * future future 187 | * spring spring 188 | * summer summer 189 | * fall fall 190 | * winter winter 191 | * end of end of 192 | * end end 193 | * long long 194 | * short short 195 | */ -------------------------------------------------------------------------------- /src/globalization/sk-SK.js: -------------------------------------------------------------------------------- 1 | Date.CultureInfo = { 2 | /* Culture Name */ 3 | name: "sk-SK", 4 | englishName: "Slovak (Slovakia)", 5 | nativeName: "slovenčina (Slovenská republika)", 6 | 7 | /* Day Name Strings */ 8 | dayNames: ["nedeľa", "pondelok", "utorok", "streda", "štvrtok", "piatok", "sobota"], 9 | abbreviatedDayNames: ["ne", "po", "ut", "st", "št", "pi", "so"], 10 | shortestDayNames: ["ne", "po", "ut", "st", "št", "pi", "so"], 11 | firstLetterDayNames: ["n", "p", "u", "s", "š", "p", "s"], 12 | 13 | /* Month Name Strings */ 14 | monthNames: ["január", "február", "marec", "apríl", "máj", "jún", "júl", "august", "september", "október", "november", "december"], 15 | abbreviatedMonthNames: ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"], 16 | 17 | /* AM/PM Designators */ 18 | amDesignator: "", 19 | pmDesignator: "", 20 | 21 | firstDayOfWeek: 1, 22 | twoDigitYearMax: 2029, 23 | 24 | /** 25 | * The dateElementOrder is based on the order of the 26 | * format specifiers in the formatPatterns.DatePattern. 27 | * 28 | * Example: 29 |
 30 |      shortDatePattern    dateElementOrder
 31 |      ------------------  ---------------- 
 32 |      "M/d/yyyy"          "mdy"
 33 |      "dd/MM/yyyy"        "dmy"
 34 |      "yyyy-MM-dd"        "ymd"
 35 |      
36 | * 37 | * The correct dateElementOrder is required by the parser to 38 | * determine the expected order of the date elements in the 39 | * string being parsed. 40 | */ 41 | dateElementOrder: "dmy", 42 | 43 | /* Standard date and time format patterns */ 44 | formatPatterns: { 45 | shortDate: "d. M. yyyy", 46 | longDate: "d. MMMM yyyy", 47 | shortTime: "H:mm", 48 | longTime: "H:mm:ss", 49 | fullDateTime: "d. MMMM yyyy H:mm:ss", 50 | sortableDateTime: "yyyy-MM-ddTHH:mm:ss", 51 | universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ", 52 | rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT", 53 | monthDay: "dd MMMM", 54 | yearMonth: "MMMM yyyy" 55 | }, 56 | 57 | /** 58 | * NOTE: If a string format is not parsing correctly, but 59 | * you would expect it parse, the problem likely lies below. 60 | * 61 | * The following regex patterns control most of the string matching 62 | * within the parser. 63 | * 64 | * The Month name and Day name patterns were automatically generated 65 | * and in general should be (mostly) correct. 66 | * 67 | * Beyond the month and day name patterns are natural language strings. 68 | * Example: "next", "today", "months" 69 | * 70 | * These natural language string may NOT be correct for this culture. 71 | * If they are not correct, please translate and edit this file 72 | * providing the correct regular expression pattern. 73 | * 74 | * If you modify this file, please post your revised CultureInfo file 75 | * to the Datejs Forum located at http://www.datejs.com/forums/. 76 | * 77 | * Please mark the subject of the post with [CultureInfo]. Example: 78 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark) 79 | * 80 | * We will add the modified patterns to the master source files. 81 | * 82 | * As well, please review the list of "Future Strings" section below. 83 | */ 84 | regexPatterns: { 85 | jan: /^január/i, 86 | feb: /^február/i, 87 | mar: /^marec/i, 88 | apr: /^apríl/i, 89 | may: /^máj/i, 90 | jun: /^jún/i, 91 | jul: /^júl/i, 92 | aug: /^august/i, 93 | sep: /^sep(t(ember)?)?/i, 94 | oct: /^október/i, 95 | nov: /^november/i, 96 | dec: /^december/i, 97 | 98 | sun: /^nedeľa/i, 99 | mon: /^pondelok/i, 100 | tue: /^utorok/i, 101 | wed: /^streda/i, 102 | thu: /^štvrtok/i, 103 | fri: /^piatok/i, 104 | sat: /^sobota/i, 105 | 106 | future: /^next/i, 107 | past: /^last|past|prev(ious)?/i, 108 | add: /^(\+|aft(er)?|from|hence)/i, 109 | subtract: /^(\-|bef(ore)?|ago)/i, 110 | 111 | yesterday: /^yes(terday)?/i, 112 | today: /^t(od(ay)?)?/i, 113 | tomorrow: /^tom(orrow)?/i, 114 | now: /^n(ow)?/i, 115 | 116 | millisecond: /^ms|milli(second)?s?/i, 117 | second: /^sec(ond)?s?/i, 118 | minute: /^mn|min(ute)?s?/i, 119 | hour: /^h(our)?s?/i, 120 | week: /^w(eek)?s?/i, 121 | month: /^m(onth)?s?/i, 122 | day: /^d(ay)?s?/i, 123 | year: /^y(ear)?s?/i, 124 | 125 | shortMeridian: /^(a|p)/i, 126 | longMeridian: /^(a\.?m?\.?|p\.?m?\.?)/i, 127 | timezone: /^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i, 128 | ordinalSuffix: /^\s*(st|nd|rd|th)/i, 129 | timeContext: /^\s*(\:|a(?!u|p)|p)/i 130 | }, 131 | 132 | timezones: [{name:"UTC", offset:"-000"}, {name:"GMT", offset:"-000"}, {name:"EST", offset:"-0500"}, {name:"EDT", offset:"-0400"}, {name:"CST", offset:"-0600"}, {name:"CDT", offset:"-0500"}, {name:"MST", offset:"-0700"}, {name:"MDT", offset:"-0600"}, {name:"PST", offset:"-0800"}, {name:"PDT", offset:"-0700"}] 133 | }; 134 | 135 | /******************** 136 | ** Future Strings ** 137 | ******************** 138 | * 139 | * The following list of strings may not be currently being used, but 140 | * may be incorporated into the Datejs library later. 141 | * 142 | * We would appreciate any help translating the strings below. 143 | * 144 | * If you modify this file, please post your revised CultureInfo file 145 | * to the Datejs Forum located at http://www.datejs.com/forums/. 146 | * 147 | * Please mark the subject of the post with [CultureInfo]. Example: 148 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark)b 149 | * 150 | * English Name Translated 151 | * ------------------ ----------------- 152 | * about about 153 | * ago ago 154 | * date date 155 | * time time 156 | * calendar calendar 157 | * show show 158 | * hourly hourly 159 | * daily daily 160 | * weekly weekly 161 | * bi-weekly bi-weekly 162 | * fortnight fortnight 163 | * monthly monthly 164 | * bi-monthly bi-monthly 165 | * quarter quarter 166 | * quarterly quarterly 167 | * yearly yearly 168 | * annual annual 169 | * annually annually 170 | * annum annum 171 | * again again 172 | * between between 173 | * after after 174 | * from now from now 175 | * repeat repeat 176 | * times times 177 | * per per 178 | * min (abbrev minute) min 179 | * morning morning 180 | * noon noon 181 | * night night 182 | * midnight midnight 183 | * mid-night mid-night 184 | * evening evening 185 | * final final 186 | * future future 187 | * spring spring 188 | * summer summer 189 | * fall fall 190 | * winter winter 191 | * end of end of 192 | * end end 193 | * long long 194 | * short short 195 | */ -------------------------------------------------------------------------------- /src/globalization/ur-PK.js: -------------------------------------------------------------------------------- 1 | Date.CultureInfo = { 2 | /* Culture Name */ 3 | name: "ur-PK", 4 | englishName: "Urdu (Islamic Republic of Pakistan)", 5 | nativeName: "اُردو (پاکستان)", 6 | 7 | /* Day Name Strings */ 8 | dayNames: ["اتوار", "پير", "منگل", "بدھ", "جمعرات", "جمعه", "هفته"], 9 | abbreviatedDayNames: ["اتوار", "پير", "منگل", "بدھ", "جمعرات", "جمعه", "هفته"], 10 | shortestDayNames: ["ا", "پ", "م", "ب", "ج", "ج", "ه"], 11 | firstLetterDayNames: ["ا", "پ", "م", "ب", "ج", "ج", "ه"], 12 | 13 | /* Month Name Strings */ 14 | monthNames: ["جنورى", "فرورى", "مارچ", "اپريل", "مئ", "جون", "جولاٸ", "اگست", "ستمبر", "اکتوبر", "نومبر", "دسمبر"], 15 | abbreviatedMonthNames: ["جنورى", "فرورى", "مارچ", "اپريل", "مئ", "جون", "جولاٸ", "اگست", "ستمبر", "اکتوبر", "نومبر", "دسمبر"], 16 | 17 | /* AM/PM Designators */ 18 | amDesignator: "AM", 19 | pmDesignator: "PM", 20 | 21 | firstDayOfWeek: 1, 22 | twoDigitYearMax: 2029, 23 | 24 | /** 25 | * The dateElementOrder is based on the order of the 26 | * format specifiers in the formatPatterns.DatePattern. 27 | * 28 | * Example: 29 |
 30 |      shortDatePattern    dateElementOrder
 31 |      ------------------  ---------------- 
 32 |      "M/d/yyyy"          "mdy"
 33 |      "dd/MM/yyyy"        "dmy"
 34 |      "yyyy-MM-dd"        "ymd"
 35 |      
36 | * 37 | * The correct dateElementOrder is required by the parser to 38 | * determine the expected order of the date elements in the 39 | * string being parsed. 40 | */ 41 | dateElementOrder: "dmy", 42 | 43 | /* Standard date and time format patterns */ 44 | formatPatterns: { 45 | shortDate: "dd/MM/yyyy", 46 | longDate: "dd MMMM, yyyy", 47 | shortTime: "h:mm tt", 48 | longTime: "h:mm:ss tt", 49 | fullDateTime: "dd MMMM, yyyy h:mm:ss tt", 50 | sortableDateTime: "yyyy-MM-ddTHH:mm:ss", 51 | universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ", 52 | rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT", 53 | monthDay: "dd MMMM", 54 | yearMonth: "MMMM, yyyy" 55 | }, 56 | 57 | /** 58 | * NOTE: If a string format is not parsing correctly, but 59 | * you would expect it parse, the problem likely lies below. 60 | * 61 | * The following regex patterns control most of the string matching 62 | * within the parser. 63 | * 64 | * The Month name and Day name patterns were automatically generated 65 | * and in general should be (mostly) correct. 66 | * 67 | * Beyond the month and day name patterns are natural language strings. 68 | * Example: "next", "today", "months" 69 | * 70 | * These natural language string may NOT be correct for this culture. 71 | * If they are not correct, please translate and edit this file 72 | * providing the correct regular expression pattern. 73 | * 74 | * If you modify this file, please post your revised CultureInfo file 75 | * to the Datejs Forum located at http://www.datejs.com/forums/. 76 | * 77 | * Please mark the subject of the post with [CultureInfo]. Example: 78 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark) 79 | * 80 | * We will add the modified patterns to the master source files. 81 | * 82 | * As well, please review the list of "Future Strings" section below. 83 | */ 84 | regexPatterns: { 85 | jan: /^جنورى/i, 86 | feb: /^فرورى/i, 87 | mar: /^مارچ/i, 88 | apr: /^اپريل/i, 89 | may: /^مئ/i, 90 | jun: /^جون/i, 91 | jul: /^جولاٸ/i, 92 | aug: /^اگست/i, 93 | sep: /^ستمبر/i, 94 | oct: /^اکتوبر/i, 95 | nov: /^نومبر/i, 96 | dec: /^دسمبر/i, 97 | 98 | sun: /^ا(1)?/i, 99 | mon: /^پ(1)?/i, 100 | tue: /^م(1)?/i, 101 | wed: /^ب(1)?/i, 102 | thu: /^ج(1)?/i, 103 | fri: /^ج(1)?/i, 104 | sat: /^ه(1)?/i, 105 | 106 | future: /^next/i, 107 | past: /^last|past|prev(ious)?/i, 108 | add: /^(\+|aft(er)?|from|hence)/i, 109 | subtract: /^(\-|bef(ore)?|ago)/i, 110 | 111 | yesterday: /^yes(terday)?/i, 112 | today: /^t(od(ay)?)?/i, 113 | tomorrow: /^tom(orrow)?/i, 114 | now: /^n(ow)?/i, 115 | 116 | millisecond: /^ms|milli(second)?s?/i, 117 | second: /^sec(ond)?s?/i, 118 | minute: /^mn|min(ute)?s?/i, 119 | hour: /^h(our)?s?/i, 120 | week: /^w(eek)?s?/i, 121 | month: /^m(onth)?s?/i, 122 | day: /^d(ay)?s?/i, 123 | year: /^y(ear)?s?/i, 124 | 125 | shortMeridian: /^(a|p)/i, 126 | longMeridian: /^(a\.?m?\.?|p\.?m?\.?)/i, 127 | timezone: /^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i, 128 | ordinalSuffix: /^\s*(st|nd|rd|th)/i, 129 | timeContext: /^\s*(\:|a(?!u|p)|p)/i 130 | }, 131 | 132 | timezones: [{name:"UTC", offset:"-000"}, {name:"GMT", offset:"-000"}, {name:"EST", offset:"-0500"}, {name:"EDT", offset:"-0400"}, {name:"CST", offset:"-0600"}, {name:"CDT", offset:"-0500"}, {name:"MST", offset:"-0700"}, {name:"MDT", offset:"-0600"}, {name:"PST", offset:"-0800"}, {name:"PDT", offset:"-0700"}] 133 | }; 134 | 135 | /******************** 136 | ** Future Strings ** 137 | ******************** 138 | * 139 | * The following list of strings may not be currently being used, but 140 | * may be incorporated into the Datejs library later. 141 | * 142 | * We would appreciate any help translating the strings below. 143 | * 144 | * If you modify this file, please post your revised CultureInfo file 145 | * to the Datejs Forum located at http://www.datejs.com/forums/. 146 | * 147 | * Please mark the subject of the post with [CultureInfo]. Example: 148 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark)b 149 | * 150 | * English Name Translated 151 | * ------------------ ----------------- 152 | * about about 153 | * ago ago 154 | * date date 155 | * time time 156 | * calendar calendar 157 | * show show 158 | * hourly hourly 159 | * daily daily 160 | * weekly weekly 161 | * bi-weekly bi-weekly 162 | * fortnight fortnight 163 | * monthly monthly 164 | * bi-monthly bi-monthly 165 | * quarter quarter 166 | * quarterly quarterly 167 | * yearly yearly 168 | * annual annual 169 | * annually annually 170 | * annum annum 171 | * again again 172 | * between between 173 | * after after 174 | * from now from now 175 | * repeat repeat 176 | * times times 177 | * per per 178 | * min (abbrev minute) min 179 | * morning morning 180 | * noon noon 181 | * night night 182 | * midnight midnight 183 | * mid-night mid-night 184 | * evening evening 185 | * final final 186 | * future future 187 | * spring spring 188 | * summer summer 189 | * fall fall 190 | * winter winter 191 | * end of end of 192 | * end end 193 | * long long 194 | * short short 195 | */ -------------------------------------------------------------------------------- /src/globalization/zh-CN.js: -------------------------------------------------------------------------------- 1 | Date.CultureInfo = { 2 | /* Culture Name */ 3 | name: "zh-CN", 4 | englishName: "Chinese (People's Republic of China)", 5 | nativeName: "中文(中华人民共和国)", 6 | 7 | /* Day Name Strings */ 8 | dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], 9 | abbreviatedDayNames: ["日", "一", "二", "三", "四", "五", "六"], 10 | shortestDayNames: ["日", "一", "二", "三", "四", "五", "六"], 11 | firstLetterDayNames: ["日", "一", "二", "三", "四", "五", "六"], 12 | 13 | /* Month Name Strings */ 14 | monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 15 | abbreviatedMonthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 16 | 17 | /* AM/PM Designators */ 18 | amDesignator: "上午", 19 | pmDesignator: "下午", 20 | 21 | firstDayOfWeek: 0, 22 | twoDigitYearMax: 2029, 23 | 24 | /** 25 | * The dateElementOrder is based on the order of the 26 | * format specifiers in the formatPatterns.DatePattern. 27 | * 28 | * Example: 29 |
 30 |      shortDatePattern    dateElementOrder
 31 |      ------------------  ---------------- 
 32 |      "M/d/yyyy"          "mdy"
 33 |      "dd/MM/yyyy"        "dmy"
 34 |      "yyyy-MM-dd"        "ymd"
 35 |      
36 | * 37 | * The correct dateElementOrder is required by the parser to 38 | * determine the expected order of the date elements in the 39 | * string being parsed. 40 | */ 41 | dateElementOrder: "ymd", 42 | 43 | /* Standard date and time format patterns */ 44 | formatPatterns: { 45 | shortDate: "yyyy/M/d", 46 | longDate: "yyyy'年'M'月'd'日'", 47 | shortTime: "H:mm", 48 | longTime: "H:mm:ss", 49 | fullDateTime: "yyyy'年'M'月'd'日' H:mm:ss", 50 | sortableDateTime: "yyyy-MM-ddTHH:mm:ss", 51 | universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ", 52 | rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT", 53 | monthDay: "M'月'd'日'", 54 | yearMonth: "yyyy'年'M'月'" 55 | }, 56 | 57 | /** 58 | * NOTE: If a string format is not parsing correctly, but 59 | * you would expect it parse, the problem likely lies below. 60 | * 61 | * The following regex patterns control most of the string matching 62 | * within the parser. 63 | * 64 | * The Month name and Day name patterns were automatically generated 65 | * and in general should be (mostly) correct. 66 | * 67 | * Beyond the month and day name patterns are natural language strings. 68 | * Example: "next", "today", "months" 69 | * 70 | * These natural language string may NOT be correct for this culture. 71 | * If they are not correct, please translate and edit this file 72 | * providing the correct regular expression pattern. 73 | * 74 | * If you modify this file, please post your revised CultureInfo file 75 | * to the Datejs Forum located at http://www.datejs.com/forums/. 76 | * 77 | * Please mark the subject of the post with [CultureInfo]. Example: 78 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark) 79 | * 80 | * We will add the modified patterns to the master source files. 81 | * 82 | * As well, please review the list of "Future Strings" section below. 83 | */ 84 | regexPatterns: { 85 | jan: /^一月/i, 86 | feb: /^二月/i, 87 | mar: /^三月/i, 88 | apr: /^四月/i, 89 | may: /^五月/i, 90 | jun: /^六月/i, 91 | jul: /^七月/i, 92 | aug: /^八月/i, 93 | sep: /^九月/i, 94 | oct: /^十月/i, 95 | nov: /^十一月/i, 96 | dec: /^十二月/i, 97 | 98 | sun: /^星期日/i, 99 | mon: /^星期一/i, 100 | tue: /^星期二/i, 101 | wed: /^星期三/i, 102 | thu: /^星期四/i, 103 | fri: /^星期五/i, 104 | sat: /^星期六/i, 105 | 106 | future: /^next/i, 107 | past: /^last|past|prev(ious)?/i, 108 | add: /^(\+|aft(er)?|from|hence)/i, 109 | subtract: /^(\-|bef(ore)?|ago)/i, 110 | 111 | yesterday: /^yes(terday)?/i, 112 | today: /^t(od(ay)?)?/i, 113 | tomorrow: /^tom(orrow)?/i, 114 | now: /^n(ow)?/i, 115 | 116 | millisecond: /^ms|milli(second)?s?/i, 117 | second: /^sec(ond)?s?/i, 118 | minute: /^mn|min(ute)?s?/i, 119 | hour: /^h(our)?s?/i, 120 | week: /^w(eek)?s?/i, 121 | month: /^m(onth)?s?/i, 122 | day: /^d(ay)?s?/i, 123 | year: /^y(ear)?s?/i, 124 | 125 | shortMeridian: /^(a|p)/i, 126 | longMeridian: /^(a\.?m?\.?|p\.?m?\.?)/i, 127 | timezone: /^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i, 128 | ordinalSuffix: /^\s*(st|nd|rd|th)/i, 129 | timeContext: /^\s*(\:|a(?!u|p)|p)/i 130 | }, 131 | 132 | timezones: [{name:"UTC", offset:"-000"}, {name:"GMT", offset:"-000"}, {name:"EST", offset:"-0500"}, {name:"EDT", offset:"-0400"}, {name:"CST", offset:"-0600"}, {name:"CDT", offset:"-0500"}, {name:"MST", offset:"-0700"}, {name:"MDT", offset:"-0600"}, {name:"PST", offset:"-0800"}, {name:"PDT", offset:"-0700"}] 133 | }; 134 | 135 | /******************** 136 | ** Future Strings ** 137 | ******************** 138 | * 139 | * The following list of strings may not be currently being used, but 140 | * may be incorporated into the Datejs library later. 141 | * 142 | * We would appreciate any help translating the strings below. 143 | * 144 | * If you modify this file, please post your revised CultureInfo file 145 | * to the Datejs Forum located at http://www.datejs.com/forums/. 146 | * 147 | * Please mark the subject of the post with [CultureInfo]. Example: 148 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark)b 149 | * 150 | * English Name Translated 151 | * ------------------ ----------------- 152 | * about about 153 | * ago ago 154 | * date date 155 | * time time 156 | * calendar calendar 157 | * show show 158 | * hourly hourly 159 | * daily daily 160 | * weekly weekly 161 | * bi-weekly bi-weekly 162 | * fortnight fortnight 163 | * monthly monthly 164 | * bi-monthly bi-monthly 165 | * quarter quarter 166 | * quarterly quarterly 167 | * yearly yearly 168 | * annual annual 169 | * annually annually 170 | * annum annum 171 | * again again 172 | * between between 173 | * after after 174 | * from now from now 175 | * repeat repeat 176 | * times times 177 | * per per 178 | * min (abbrev minute) min 179 | * morning morning 180 | * noon noon 181 | * night night 182 | * midnight midnight 183 | * mid-night mid-night 184 | * evening evening 185 | * final final 186 | * future future 187 | * spring spring 188 | * summer summer 189 | * fall fall 190 | * winter winter 191 | * end of end of 192 | * end end 193 | * long long 194 | * short short 195 | */ -------------------------------------------------------------------------------- /src/globalization/zh-MO.js: -------------------------------------------------------------------------------- 1 | Date.CultureInfo = { 2 | /* Culture Name */ 3 | name: "zh-MO", 4 | englishName: "Chinese (Macao S.A.R.)", 5 | nativeName: "中文(澳門特别行政區)", 6 | 7 | /* Day Name Strings */ 8 | dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], 9 | abbreviatedDayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], 10 | shortestDayNames: ["日", "一", "二", "三", "四", "五", "六"], 11 | firstLetterDayNames: ["日", "一", "二", "三", "四", "五", "六"], 12 | 13 | /* Month Name Strings */ 14 | monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 15 | abbreviatedMonthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 16 | 17 | /* AM/PM Designators */ 18 | amDesignator: "", 19 | pmDesignator: "", 20 | 21 | firstDayOfWeek: 0, 22 | twoDigitYearMax: 2029, 23 | 24 | /** 25 | * The dateElementOrder is based on the order of the 26 | * format specifiers in the formatPatterns.DatePattern. 27 | * 28 | * Example: 29 |
 30 |      shortDatePattern    dateElementOrder
 31 |      ------------------  ---------------- 
 32 |      "M/d/yyyy"          "mdy"
 33 |      "dd/MM/yyyy"        "dmy"
 34 |      "yyyy-MM-dd"        "ymd"
 35 |      
36 | * 37 | * The correct dateElementOrder is required by the parser to 38 | * determine the expected order of the date elements in the 39 | * string being parsed. 40 | */ 41 | dateElementOrder: "dmy", 42 | 43 | /* Standard date and time format patterns */ 44 | formatPatterns: { 45 | shortDate: "d/M/yyyy", 46 | longDate: "dddd, d MMMM, yyyy", 47 | shortTime: "H:mm", 48 | longTime: "H:mm:ss", 49 | fullDateTime: "dddd, d MMMM, yyyy H:mm:ss", 50 | sortableDateTime: "yyyy-MM-ddTHH:mm:ss", 51 | universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ", 52 | rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT", 53 | monthDay: "d MMMM", 54 | yearMonth: "MMMM, yyyy" 55 | }, 56 | 57 | /** 58 | * NOTE: If a string format is not parsing correctly, but 59 | * you would expect it parse, the problem likely lies below. 60 | * 61 | * The following regex patterns control most of the string matching 62 | * within the parser. 63 | * 64 | * The Month name and Day name patterns were automatically generated 65 | * and in general should be (mostly) correct. 66 | * 67 | * Beyond the month and day name patterns are natural language strings. 68 | * Example: "next", "today", "months" 69 | * 70 | * These natural language string may NOT be correct for this culture. 71 | * If they are not correct, please translate and edit this file 72 | * providing the correct regular expression pattern. 73 | * 74 | * If you modify this file, please post your revised CultureInfo file 75 | * to the Datejs Forum located at http://www.datejs.com/forums/. 76 | * 77 | * Please mark the subject of the post with [CultureInfo]. Example: 78 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark) 79 | * 80 | * We will add the modified patterns to the master source files. 81 | * 82 | * As well, please review the list of "Future Strings" section below. 83 | */ 84 | regexPatterns: { 85 | jan: /^一月/i, 86 | feb: /^二月/i, 87 | mar: /^三月/i, 88 | apr: /^四月/i, 89 | may: /^五月/i, 90 | jun: /^六月/i, 91 | jul: /^七月/i, 92 | aug: /^八月/i, 93 | sep: /^九月/i, 94 | oct: /^十月/i, 95 | nov: /^十一月/i, 96 | dec: /^十二月/i, 97 | 98 | sun: /^星期日/i, 99 | mon: /^星期一/i, 100 | tue: /^星期二/i, 101 | wed: /^星期三/i, 102 | thu: /^星期四/i, 103 | fri: /^星期五/i, 104 | sat: /^星期六/i, 105 | 106 | future: /^next/i, 107 | past: /^last|past|prev(ious)?/i, 108 | add: /^(\+|aft(er)?|from|hence)/i, 109 | subtract: /^(\-|bef(ore)?|ago)/i, 110 | 111 | yesterday: /^yes(terday)?/i, 112 | today: /^t(od(ay)?)?/i, 113 | tomorrow: /^tom(orrow)?/i, 114 | now: /^n(ow)?/i, 115 | 116 | millisecond: /^ms|milli(second)?s?/i, 117 | second: /^sec(ond)?s?/i, 118 | minute: /^mn|min(ute)?s?/i, 119 | hour: /^h(our)?s?/i, 120 | week: /^w(eek)?s?/i, 121 | month: /^m(onth)?s?/i, 122 | day: /^d(ay)?s?/i, 123 | year: /^y(ear)?s?/i, 124 | 125 | shortMeridian: /^(a|p)/i, 126 | longMeridian: /^(a\.?m?\.?|p\.?m?\.?)/i, 127 | timezone: /^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i, 128 | ordinalSuffix: /^\s*(st|nd|rd|th)/i, 129 | timeContext: /^\s*(\:|a(?!u|p)|p)/i 130 | }, 131 | 132 | timezones: [{name:"UTC", offset:"-000"}, {name:"GMT", offset:"-000"}, {name:"EST", offset:"-0500"}, {name:"EDT", offset:"-0400"}, {name:"CST", offset:"-0600"}, {name:"CDT", offset:"-0500"}, {name:"MST", offset:"-0700"}, {name:"MDT", offset:"-0600"}, {name:"PST", offset:"-0800"}, {name:"PDT", offset:"-0700"}] 133 | }; 134 | 135 | /******************** 136 | ** Future Strings ** 137 | ******************** 138 | * 139 | * The following list of strings may not be currently being used, but 140 | * may be incorporated into the Datejs library later. 141 | * 142 | * We would appreciate any help translating the strings below. 143 | * 144 | * If you modify this file, please post your revised CultureInfo file 145 | * to the Datejs Forum located at http://www.datejs.com/forums/. 146 | * 147 | * Please mark the subject of the post with [CultureInfo]. Example: 148 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark)b 149 | * 150 | * English Name Translated 151 | * ------------------ ----------------- 152 | * about about 153 | * ago ago 154 | * date date 155 | * time time 156 | * calendar calendar 157 | * show show 158 | * hourly hourly 159 | * daily daily 160 | * weekly weekly 161 | * bi-weekly bi-weekly 162 | * fortnight fortnight 163 | * monthly monthly 164 | * bi-monthly bi-monthly 165 | * quarter quarter 166 | * quarterly quarterly 167 | * yearly yearly 168 | * annual annual 169 | * annually annually 170 | * annum annum 171 | * again again 172 | * between between 173 | * after after 174 | * from now from now 175 | * repeat repeat 176 | * times times 177 | * per per 178 | * min (abbrev minute) min 179 | * morning morning 180 | * noon noon 181 | * night night 182 | * midnight midnight 183 | * mid-night mid-night 184 | * evening evening 185 | * final final 186 | * future future 187 | * spring spring 188 | * summer summer 189 | * fall fall 190 | * winter winter 191 | * end of end of 192 | * end end 193 | * long long 194 | * short short 195 | */ -------------------------------------------------------------------------------- /src/globalization/zh-SG.js: -------------------------------------------------------------------------------- 1 | Date.CultureInfo = { 2 | /* Culture Name */ 3 | name: "zh-SG", 4 | englishName: "Chinese (Singapore)", 5 | nativeName: "中文(新加坡)", 6 | 7 | /* Day Name Strings */ 8 | dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], 9 | abbreviatedDayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], 10 | shortestDayNames: ["日", "一", "二", "三", "四", "五", "六"], 11 | firstLetterDayNames: ["日", "一", "二", "三", "四", "五", "六"], 12 | 13 | /* Month Name Strings */ 14 | monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 15 | abbreviatedMonthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 16 | 17 | /* AM/PM Designators */ 18 | amDesignator: "AM", 19 | pmDesignator: "PM", 20 | 21 | firstDayOfWeek: 0, 22 | twoDigitYearMax: 2029, 23 | 24 | /** 25 | * The dateElementOrder is based on the order of the 26 | * format specifiers in the formatPatterns.DatePattern. 27 | * 28 | * Example: 29 |
 30 |      shortDatePattern    dateElementOrder
 31 |      ------------------  ---------------- 
 32 |      "M/d/yyyy"          "mdy"
 33 |      "dd/MM/yyyy"        "dmy"
 34 |      "yyyy-MM-dd"        "ymd"
 35 |      
36 | * 37 | * The correct dateElementOrder is required by the parser to 38 | * determine the expected order of the date elements in the 39 | * string being parsed. 40 | */ 41 | dateElementOrder: "dmy", 42 | 43 | /* Standard date and time format patterns */ 44 | formatPatterns: { 45 | shortDate: "d/M/yyyy", 46 | longDate: "dddd, d MMMM, yyyy", 47 | shortTime: "tt h:mm", 48 | longTime: "tt h:mm:ss", 49 | fullDateTime: "dddd, d MMMM, yyyy tt h:mm:ss", 50 | sortableDateTime: "yyyy-MM-ddTHH:mm:ss", 51 | universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ", 52 | rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT", 53 | monthDay: "d MMMM", 54 | yearMonth: "MMMM, yyyy" 55 | }, 56 | 57 | /** 58 | * NOTE: If a string format is not parsing correctly, but 59 | * you would expect it parse, the problem likely lies below. 60 | * 61 | * The following regex patterns control most of the string matching 62 | * within the parser. 63 | * 64 | * The Month name and Day name patterns were automatically generated 65 | * and in general should be (mostly) correct. 66 | * 67 | * Beyond the month and day name patterns are natural language strings. 68 | * Example: "next", "today", "months" 69 | * 70 | * These natural language string may NOT be correct for this culture. 71 | * If they are not correct, please translate and edit this file 72 | * providing the correct regular expression pattern. 73 | * 74 | * If you modify this file, please post your revised CultureInfo file 75 | * to the Datejs Forum located at http://www.datejs.com/forums/. 76 | * 77 | * Please mark the subject of the post with [CultureInfo]. Example: 78 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark) 79 | * 80 | * We will add the modified patterns to the master source files. 81 | * 82 | * As well, please review the list of "Future Strings" section below. 83 | */ 84 | regexPatterns: { 85 | jan: /^一月/i, 86 | feb: /^二月/i, 87 | mar: /^三月/i, 88 | apr: /^四月/i, 89 | may: /^五月/i, 90 | jun: /^六月/i, 91 | jul: /^七月/i, 92 | aug: /^八月/i, 93 | sep: /^九月/i, 94 | oct: /^十月/i, 95 | nov: /^十一月/i, 96 | dec: /^十二月/i, 97 | 98 | sun: /^星期日/i, 99 | mon: /^星期一/i, 100 | tue: /^星期二/i, 101 | wed: /^星期三/i, 102 | thu: /^星期四/i, 103 | fri: /^星期五/i, 104 | sat: /^星期六/i, 105 | 106 | future: /^next/i, 107 | past: /^last|past|prev(ious)?/i, 108 | add: /^(\+|aft(er)?|from|hence)/i, 109 | subtract: /^(\-|bef(ore)?|ago)/i, 110 | 111 | yesterday: /^yes(terday)?/i, 112 | today: /^t(od(ay)?)?/i, 113 | tomorrow: /^tom(orrow)?/i, 114 | now: /^n(ow)?/i, 115 | 116 | millisecond: /^ms|milli(second)?s?/i, 117 | second: /^sec(ond)?s?/i, 118 | minute: /^mn|min(ute)?s?/i, 119 | hour: /^h(our)?s?/i, 120 | week: /^w(eek)?s?/i, 121 | month: /^m(onth)?s?/i, 122 | day: /^d(ay)?s?/i, 123 | year: /^y(ear)?s?/i, 124 | 125 | shortMeridian: /^(a|p)/i, 126 | longMeridian: /^(a\.?m?\.?|p\.?m?\.?)/i, 127 | timezone: /^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i, 128 | ordinalSuffix: /^\s*(st|nd|rd|th)/i, 129 | timeContext: /^\s*(\:|a(?!u|p)|p)/i 130 | }, 131 | 132 | timezones: [{name:"UTC", offset:"-000"}, {name:"GMT", offset:"-000"}, {name:"EST", offset:"-0500"}, {name:"EDT", offset:"-0400"}, {name:"CST", offset:"-0600"}, {name:"CDT", offset:"-0500"}, {name:"MST", offset:"-0700"}, {name:"MDT", offset:"-0600"}, {name:"PST", offset:"-0800"}, {name:"PDT", offset:"-0700"}] 133 | }; 134 | 135 | /******************** 136 | ** Future Strings ** 137 | ******************** 138 | * 139 | * The following list of strings may not be currently being used, but 140 | * may be incorporated into the Datejs library later. 141 | * 142 | * We would appreciate any help translating the strings below. 143 | * 144 | * If you modify this file, please post your revised CultureInfo file 145 | * to the Datejs Forum located at http://www.datejs.com/forums/. 146 | * 147 | * Please mark the subject of the post with [CultureInfo]. Example: 148 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark)b 149 | * 150 | * English Name Translated 151 | * ------------------ ----------------- 152 | * about about 153 | * ago ago 154 | * date date 155 | * time time 156 | * calendar calendar 157 | * show show 158 | * hourly hourly 159 | * daily daily 160 | * weekly weekly 161 | * bi-weekly bi-weekly 162 | * fortnight fortnight 163 | * monthly monthly 164 | * bi-monthly bi-monthly 165 | * quarter quarter 166 | * quarterly quarterly 167 | * yearly yearly 168 | * annual annual 169 | * annually annually 170 | * annum annum 171 | * again again 172 | * between between 173 | * after after 174 | * from now from now 175 | * repeat repeat 176 | * times times 177 | * per per 178 | * min (abbrev minute) min 179 | * morning morning 180 | * noon noon 181 | * night night 182 | * midnight midnight 183 | * mid-night mid-night 184 | * evening evening 185 | * final final 186 | * future future 187 | * spring spring 188 | * summer summer 189 | * fall fall 190 | * winter winter 191 | * end of end of 192 | * end end 193 | * long long 194 | * short short 195 | */ -------------------------------------------------------------------------------- /src/globalization/zh-TW.js: -------------------------------------------------------------------------------- 1 | Date.CultureInfo = { 2 | /* Culture Name */ 3 | name: "zh-TW", 4 | englishName: "Chinese (Taiwan)", 5 | nativeName: "中文(台灣)", 6 | 7 | /* Day Name Strings */ 8 | dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], 9 | abbreviatedDayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], 10 | shortestDayNames: ["日", "一", "二", "三", "四", "五", "六"], 11 | firstLetterDayNames: ["日", "一", "二", "三", "四", "五", "六"], 12 | 13 | /* Month Name Strings */ 14 | monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 15 | abbreviatedMonthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 16 | 17 | /* AM/PM Designators */ 18 | amDesignator: "上午", 19 | pmDesignator: "下午", 20 | 21 | firstDayOfWeek: 0, 22 | twoDigitYearMax: 2029, 23 | 24 | /** 25 | * The dateElementOrder is based on the order of the 26 | * format specifiers in the formatPatterns.DatePattern. 27 | * 28 | * Example: 29 |
 30 |      shortDatePattern    dateElementOrder
 31 |      ------------------  ---------------- 
 32 |      "M/d/yyyy"          "mdy"
 33 |      "dd/MM/yyyy"        "dmy"
 34 |      "yyyy-MM-dd"        "ymd"
 35 |      
36 | * 37 | * The correct dateElementOrder is required by the parser to 38 | * determine the expected order of the date elements in the 39 | * string being parsed. 40 | */ 41 | dateElementOrder: "ymd", 42 | 43 | /* Standard date and time format patterns */ 44 | formatPatterns: { 45 | shortDate: "yyyy/M/d", 46 | longDate: "yyyy'年'M'月'd'日'", 47 | shortTime: "tt hh:mm", 48 | longTime: "tt hh:mm:ss", 49 | fullDateTime: "yyyy'年'M'月'd'日' tt hh:mm:ss", 50 | sortableDateTime: "yyyy-MM-ddTHH:mm:ss", 51 | universalSortableDateTime: "yyyy-MM-dd HH:mm:ssZ", 52 | rfc1123: "ddd, dd MMM yyyy HH:mm:ss GMT", 53 | monthDay: "M'月'd'日'", 54 | yearMonth: "yyyy'年'M'月'" 55 | }, 56 | 57 | /** 58 | * NOTE: If a string format is not parsing correctly, but 59 | * you would expect it parse, the problem likely lies below. 60 | * 61 | * The following regex patterns control most of the string matching 62 | * within the parser. 63 | * 64 | * The Month name and Day name patterns were automatically generated 65 | * and in general should be (mostly) correct. 66 | * 67 | * Beyond the month and day name patterns are natural language strings. 68 | * Example: "next", "today", "months" 69 | * 70 | * These natural language string may NOT be correct for this culture. 71 | * If they are not correct, please translate and edit this file 72 | * providing the correct regular expression pattern. 73 | * 74 | * If you modify this file, please post your revised CultureInfo file 75 | * to the Datejs Forum located at http://www.datejs.com/forums/. 76 | * 77 | * Please mark the subject of the post with [CultureInfo]. Example: 78 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark) 79 | * 80 | * We will add the modified patterns to the master source files. 81 | * 82 | * As well, please review the list of "Future Strings" section below. 83 | */ 84 | regexPatterns: { 85 | jan: /^一月/i, 86 | feb: /^二月/i, 87 | mar: /^三月/i, 88 | apr: /^四月/i, 89 | may: /^五月/i, 90 | jun: /^六月/i, 91 | jul: /^七月/i, 92 | aug: /^八月/i, 93 | sep: /^九月/i, 94 | oct: /^十月/i, 95 | nov: /^十一月/i, 96 | dec: /^十二月/i, 97 | 98 | sun: /^星期日/i, 99 | mon: /^星期一/i, 100 | tue: /^星期二/i, 101 | wed: /^星期三/i, 102 | thu: /^星期四/i, 103 | fri: /^星期五/i, 104 | sat: /^星期六/i, 105 | 106 | future: /^next/i, 107 | past: /^last|past|prev(ious)?/i, 108 | add: /^(\+|aft(er)?|from|hence)/i, 109 | subtract: /^(\-|bef(ore)?|ago)/i, 110 | 111 | yesterday: /^yes(terday)?/i, 112 | today: /^t(od(ay)?)?/i, 113 | tomorrow: /^tom(orrow)?/i, 114 | now: /^n(ow)?/i, 115 | 116 | millisecond: /^ms|milli(second)?s?/i, 117 | second: /^sec(ond)?s?/i, 118 | minute: /^mn|min(ute)?s?/i, 119 | hour: /^h(our)?s?/i, 120 | week: /^w(eek)?s?/i, 121 | month: /^m(onth)?s?/i, 122 | day: /^d(ay)?s?/i, 123 | year: /^y(ear)?s?/i, 124 | 125 | shortMeridian: /^(a|p)/i, 126 | longMeridian: /^(a\.?m?\.?|p\.?m?\.?)/i, 127 | timezone: /^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i, 128 | ordinalSuffix: /^\s*(st|nd|rd|th)/i, 129 | timeContext: /^\s*(\:|a(?!u|p)|p)/i 130 | }, 131 | 132 | timezones: [{name:"UTC", offset:"-000"}, {name:"GMT", offset:"-000"}, {name:"EST", offset:"-0500"}, {name:"EDT", offset:"-0400"}, {name:"CST", offset:"-0600"}, {name:"CDT", offset:"-0500"}, {name:"MST", offset:"-0700"}, {name:"MDT", offset:"-0600"}, {name:"PST", offset:"-0800"}, {name:"PDT", offset:"-0700"}] 133 | }; 134 | 135 | /******************** 136 | ** Future Strings ** 137 | ******************** 138 | * 139 | * The following list of strings may not be currently being used, but 140 | * may be incorporated into the Datejs library later. 141 | * 142 | * We would appreciate any help translating the strings below. 143 | * 144 | * If you modify this file, please post your revised CultureInfo file 145 | * to the Datejs Forum located at http://www.datejs.com/forums/. 146 | * 147 | * Please mark the subject of the post with [CultureInfo]. Example: 148 | * Subject: [CultureInfo] Translated "da-DK" Danish(Denmark)b 149 | * 150 | * English Name Translated 151 | * ------------------ ----------------- 152 | * about about 153 | * ago ago 154 | * date date 155 | * time time 156 | * calendar calendar 157 | * show show 158 | * hourly hourly 159 | * daily daily 160 | * weekly weekly 161 | * bi-weekly bi-weekly 162 | * fortnight fortnight 163 | * monthly monthly 164 | * bi-monthly bi-monthly 165 | * quarter quarter 166 | * quarterly quarterly 167 | * yearly yearly 168 | * annual annual 169 | * annually annually 170 | * annum annum 171 | * again again 172 | * between between 173 | * after after 174 | * from now from now 175 | * repeat repeat 176 | * times times 177 | * per per 178 | * min (abbrev minute) min 179 | * morning morning 180 | * noon noon 181 | * night night 182 | * midnight midnight 183 | * mid-night mid-night 184 | * evening evening 185 | * final final 186 | * future future 187 | * spring spring 188 | * summer summer 189 | * fall fall 190 | * winter winter 191 | * end of end of 192 | * end end 193 | * long long 194 | * short short 195 | */ -------------------------------------------------------------------------------- /test/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : Core Library 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 |

Core Library

34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /test/core/jasmine.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : Core Library 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /test/culture_info/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : CultureInfo 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | 31 | 32 |

es-MX CultureInfo

33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /test/culture_info/index.js: -------------------------------------------------------------------------------- 1 | Date.Specification = new Specification({ 2 | 'Overview': { 3 | setup: function() { this.baseline = new Date('7/8/2004') }, 4 | 'Julio 8, 2004 : Espanol': { 5 | run: function() { this.date = Date.parse( 'Julio 8, 2004' ) }, 6 | assert: function() { return this.baseline.equals( this.date ) } 7 | } 8 | } 9 | }); 10 | 11 | -------------------------------------------------------------------------------- /test/date/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : Dates 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 |

Dates

34 |
35 | 36 | -------------------------------------------------------------------------------- /test/date2/date2.js: -------------------------------------------------------------------------------- 1 | var Date2 = function(x) { 2 | this.year = 0; this.month = 0; this.day = 1; 3 | this.hour = 0; this.minute = 0; this.second = 0; this.millisecond = 0; 4 | if ( x instanceof String ) { 5 | // TODO: convert parse to Date2 6 | return Date2.parse(x); 7 | } else if ( x instanceof Object ) { 8 | this.set(x); 9 | } else if (arguments.length == 0 ) { 10 | // TODO: get values from new Date() 11 | } 12 | }; 13 | 14 | Date.prototype = { 15 | toMilliseconds: function() { 16 | // TODO: Adjust for timezone ... 17 | return new Date(this.year, this.month, this.day, 18 | this.hour, this.minute, this.second, this.millisecond).getMilliseconds(); 19 | }, 20 | toString: function(fmt) { 21 | if ( fmt !== undefined ) { 22 | // TODO: format the string 23 | } else { 24 | // TODO: implement 'abbreviated' functions 25 | var datePart = [ this.getAbbreviatedDayOfWeek(), this.getAbbreviatedMonthName(), 26 | this.getDay(), this.getYear() ].join(' '); 27 | var timePart = [ this.getHour(), this.getMinute(), this.getSecond() ].join(':'); 28 | return [ datePart, timePart, this.getTimezone() ].join(' '); 29 | } 30 | } 31 | }; 32 | 33 | (function() { 34 | var capitalize = function(s) { return s.slice(0,1).toUpperCase() + s.slice(1); } 35 | var getterFn = function(attr) { return function() { return this[attr]; }; }; 36 | var setterFn = function(attr) { return function(val) { this[attr] = val; return this; }; }; 37 | var addFn = function(attr) { return function(val) { this[attr] += val; return this; }; }; 38 | var attributes = 'year month day hour minute second millisecond timezone'.split(/\s+/); 39 | for ( var i = 0; i < attributes.length ; i++ ) { 40 | var A = capitalize( attributes[i] ), a = attributes[i]; 41 | Date2.prototype['get'+A] = getterFn(a); 42 | Date2.prototype['set'+A] = setterFn(a); 43 | Date2.prototype['add'+A] = addFn(a); 44 | } 45 | var bulk = function(name) { 46 | Date2.prototype[ name ] = function(obj) { 47 | for ( var i = 0; i < attributes.length ; i++ ) { 48 | var attribute = capitalize( attributes[i] ); 49 | if ( obj[attributes[i]]!= null ) { 50 | console.log(name+attribute); 51 | this[ name + attribute ]( obj[attributes[i]] ); } 52 | } 53 | return this; 54 | }; 55 | }; 56 | bulk('add'); bulk('set'); 57 | }()); -------------------------------------------------------------------------------- /test/date2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Date2 Experiment 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |

Date2 Experiment

15 | 16 | 17 | -------------------------------------------------------------------------------- /test/date_and_time/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : Date and Times 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 |

Date and Times

34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /test/date_math/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : Date Math 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 |

Date Math

34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /test/dst/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : Daylight Saving Time 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 |

Daylight Saving Time

35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /test/dst/index.js: -------------------------------------------------------------------------------- 1 | if(typeof require !== 'undefined') { 2 | var Specification = require('../scripts/specification-converter.js'); 3 | } 4 | 5 | Date.Specification = new Specification({ 6 | 'Daylight Saving Time': { 7 | setup: function() { }, 8 | '3/11/2007 1:59:59 + 1 second = 3/11/2007 3:00:00': { 9 | run: function() { }, 10 | assert: function() { 11 | return new Date(2007,2,11,1,59,59).addSeconds(1).equals(new Date(2007,2,11,3,0,0)); 12 | } 13 | }, 14 | }, 15 | 'Quriks': { 16 | "End of DST Doesn't work the way Start of DST does": { 17 | //at the end of DST, the date doesn't jump backwards. instead, just the timezone changes 18 | //to ensure that this is caught, we compare the timezone offsets between the two dates 19 | run: function() { }, 20 | assert: function() { 21 | var date1 = new Date(2015,10,1,2,0,0,0); 22 | var date2 = new Date(2015,10,1,2,0,0,-1); 23 | return date1.getTimezoneOffset() != date2.getTimezoneOffset(); 24 | } 25 | }, 26 | } 27 | 28 | }); 29 | 30 | -------------------------------------------------------------------------------- /test/images/accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datejs/Datejs/56b945cf4ebb6b8eb6404c47697bd518e3d413b0/test/images/accept.png -------------------------------------------------------------------------------- /test/images/exclamation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datejs/Datejs/56b945cf4ebb6b8eb6404c47697bd518e3d413b0/test/images/exclamation.png -------------------------------------------------------------------------------- /test/images/information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datejs/Datejs/56b945cf4ebb6b8eb6404c47697bd518e3d413b0/test/images/information.png -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 73 | 74 | 75 | 76 |

Datejs Test Cases

77 |
    78 |
  1. Date
  2. 79 |
  3. Time
  4. 80 |
  5. Date and Time
  6. 81 |
  7. Partial
  8. 82 |
  9. Relative
  10. 83 |
  11. Relative Date and Time
  12. 84 |
  13. Date Math
  14. 85 |
  15. ParseExact
  16. 86 |
  17. Core Library
  18. 87 |
  19. Sugarpak
  20. 88 |
  21. .toString Function
  22. 89 |
  23. Daylight Saving Time
  24. 90 |
  25. CulturalInfo (es-MX)
  26. 91 |
92 |

Compare to other libraries

93 |
    94 |
  1. RememberTheMilk.com
  2. 95 |
  3. Ruby Chronic
  4. 96 |
97 | 98 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /test/jQuery/datepicker.css: -------------------------------------------------------------------------------- 1 | /* Main Style Sheet for jQuery UI date picker */ 2 | #datepicker_div, .datepicker_inline { 3 | font-family: Arial, Helvetica, sans-serif; 4 | font-size: 14px; 5 | padding: 0; 6 | margin: 0; 7 | background: #ddd; 8 | width: 185px; 9 | } 10 | #datepicker_div { 11 | display: none; 12 | border: 1px solid #777; 13 | z-index: 10; /*must have*/ 14 | } 15 | .datepicker_inline { 16 | float: left; 17 | display: block; 18 | border: 0; 19 | } 20 | .datepicker_dialog { 21 | padding: 5px !important; 22 | border: 4px ridge #ddd !important; 23 | } 24 | button.datepicker_trigger { 25 | width: 25px; 26 | } 27 | img.datepicker_trigger { 28 | margin: 2px; 29 | vertical-align: middle; 30 | } 31 | .datepicker_prompt { 32 | float: left; 33 | padding: 2px; 34 | background: #ddd; 35 | color: #000; 36 | } 37 | * html .datepicker_prompt { 38 | width: 185px; 39 | } 40 | .datepicker_control, .datepicker_links, .datepicker_header, .datepicker { 41 | clear: both; 42 | float: left; 43 | width: 100%; 44 | color: #fff; 45 | } 46 | .datepicker_control { 47 | background: #400; 48 | padding: 2px 0px; 49 | } 50 | .datepicker_links { 51 | background: #000; 52 | padding: 2px 0px; 53 | } 54 | .datepicker_control, .datepicker_links { 55 | font-weight: bold; 56 | font-size: 80%; 57 | letter-spacing: 1px; 58 | } 59 | .datepicker_links label { /* disabled links */ 60 | padding: 2px 5px; 61 | color: #888; 62 | } 63 | .datepicker_clear, .datepicker_prev { 64 | float: left; 65 | width: 34%; 66 | } 67 | .datepicker_current { 68 | float: left; 69 | width: 30%; 70 | text-align: center; 71 | } 72 | .datepicker_close, .datepicker_next { 73 | float: right; 74 | width: 34%; 75 | text-align: right; 76 | } 77 | .datepicker_header { 78 | padding: 1px 0 3px; 79 | background: #333; 80 | text-align: center; 81 | font-weight: bold; 82 | height: 1.3em; 83 | } 84 | .datepicker_header select { 85 | background: #333; 86 | color: #fff; 87 | border: 0px; 88 | font-weight: bold; 89 | } 90 | .datepicker { 91 | background: #ccc; 92 | text-align: center; 93 | font-size: 100%; 94 | } 95 | .datepicker a { 96 | display: block; 97 | width: 100%; 98 | } 99 | .datepicker_titleRow { 100 | background: #777; 101 | } 102 | .datepicker_daysRow { 103 | background: #eee; 104 | color: #666; 105 | } 106 | .datepicker_weekCol { 107 | background: #777; 108 | color: #fff; 109 | } 110 | .datepicker_daysCell { 111 | color: #000; 112 | border: 1px solid #ddd; 113 | } 114 | .datepicker_daysCell a{ 115 | display: block; 116 | } 117 | .datepicker_weekEndCell { 118 | background: #ddd; 119 | } 120 | .datepicker_daysCellOver { 121 | background: #fff; 122 | border: 1px solid #777; 123 | } 124 | .datepicker_unselectable { 125 | color: #888; 126 | } 127 | .datepicker_today { 128 | background: #fcc !important; 129 | } 130 | .datepicker_currentDay { 131 | background: #999 !important; 132 | } 133 | .datepicker_status { 134 | background: #ddd; 135 | width: 100%; 136 | font-size: 80%; 137 | text-align: center; 138 | } 139 | 140 | /* ________ Datepicker Links _______ 141 | 142 | ** Reset link properties and then override them with !important */ 143 | #datepicker_div a, .datepicker_inline a { 144 | cursor: pointer; 145 | margin: 0; 146 | padding: 0; 147 | background: none; 148 | color: #000; 149 | } 150 | .datepicker_inline .datepicker_links a { 151 | padding: 0 5px !important; 152 | } 153 | .datepicker_control a, .datepicker_links a { 154 | padding: 2px 5px !important; 155 | color: #eee !important; 156 | } 157 | .datepicker_titleRow a { 158 | color: #eee !important; 159 | } 160 | .datepicker_control a:hover { 161 | background: #fdd !important; 162 | color: #333 !important; 163 | } 164 | .datepicker_links a:hover, .datepicker_titleRow a:hover { 165 | background: #ddd !important; 166 | color: #333 !important; 167 | } 168 | 169 | /* ___________ MULTIPLE MONTHS _________*/ 170 | 171 | .datepicker_multi .datepicker { 172 | border: 1px solid #777; 173 | } 174 | .datepicker_oneMonth { 175 | float: left; 176 | width: 185px; 177 | } 178 | .datepicker_newRow { 179 | clear: left; 180 | } 181 | 182 | /* ___________ IE6 IFRAME FIX ________ */ 183 | 184 | .datepicker_cover { 185 | display: none; /*sorry for IE5*/ 186 | display/**/: block; /*sorry for IE5*/ 187 | position: absolute; /*must have*/ 188 | z-index: -1; /*must have*/ 189 | filter: mask(); /*must have*/ 190 | top: -4px; /*must have*/ 191 | left: -4px; /*must have*/ 192 | width: 200px; /*must have*/ 193 | height: 200px; /*must have*/ 194 | } -------------------------------------------------------------------------------- /test/jQuery/datepicker.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | jQuery Datepicker Core Demo 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |

UI Datepicker Core Components

30 |

31 | 32 | 33 |

34 | 35 | -------------------------------------------------------------------------------- /test/jasmine/MIT.LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2014 Pivotal Labs 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /test/jasmine/SpecRunner.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Jasmine Spec Runner v2.3.4 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /test/jasmine/lib/jasmine-2.3.4/boot.js: -------------------------------------------------------------------------------- 1 | /** 2 | Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js` and `jasmine_html.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project. 3 | 4 | If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms. 5 | 6 | The location of `boot.js` can be specified and/or overridden in `jasmine.yml`. 7 | 8 | [jasmine-gem]: http://github.com/pivotal/jasmine-gem 9 | */ 10 | 11 | (function() { 12 | 13 | /** 14 | * ## Require & Instantiate 15 | * 16 | * Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference. 17 | */ 18 | window.jasmine = jasmineRequire.core(jasmineRequire); 19 | 20 | /** 21 | * Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference. 22 | */ 23 | jasmineRequire.html(jasmine); 24 | 25 | /** 26 | * Create the Jasmine environment. This is used to run all specs in a project. 27 | */ 28 | var env = jasmine.getEnv(); 29 | 30 | /** 31 | * ## The Global Interface 32 | * 33 | * Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged. 34 | */ 35 | var jasmineInterface = jasmineRequire.interface(jasmine, env); 36 | 37 | /** 38 | * Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`. 39 | */ 40 | extend(window, jasmineInterface); 41 | 42 | /** 43 | * ## Runner Parameters 44 | * 45 | * More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface. 46 | */ 47 | 48 | var queryString = new jasmine.QueryString({ 49 | getWindowLocation: function() { return window.location; } 50 | }); 51 | 52 | var catchingExceptions = queryString.getParam("catch"); 53 | env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions); 54 | 55 | var throwingExpectationFailures = queryString.getParam("throwFailures"); 56 | env.throwOnExpectationFailure(throwingExpectationFailures); 57 | 58 | /** 59 | * ## Reporters 60 | * The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any). 61 | */ 62 | var htmlReporter = new jasmine.HtmlReporter({ 63 | env: env, 64 | onRaiseExceptionsClick: function() { queryString.navigateWithNewParam("catch", !env.catchingExceptions()); }, 65 | onThrowExpectationsClick: function() { queryString.navigateWithNewParam("throwFailures", !env.throwingExpectationFailures()); }, 66 | addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); }, 67 | getContainer: function() { return document.body; }, 68 | createElement: function() { return document.createElement.apply(document, arguments); }, 69 | createTextNode: function() { return document.createTextNode.apply(document, arguments); }, 70 | timer: new jasmine.Timer() 71 | }); 72 | 73 | /** 74 | * The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript. 75 | */ 76 | env.addReporter(jasmineInterface.jsApiReporter); 77 | env.addReporter(htmlReporter); 78 | 79 | /** 80 | * Filter which specs will be run by matching the start of the full name against the `spec` query param. 81 | */ 82 | var specFilter = new jasmine.HtmlSpecFilter({ 83 | filterString: function() { return queryString.getParam("spec"); } 84 | }); 85 | 86 | env.specFilter = function(spec) { 87 | return specFilter.matches(spec.getFullName()); 88 | }; 89 | 90 | /** 91 | * Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack. 92 | */ 93 | window.setTimeout = window.setTimeout; 94 | window.setInterval = window.setInterval; 95 | window.clearTimeout = window.clearTimeout; 96 | window.clearInterval = window.clearInterval; 97 | 98 | /** 99 | * ## Execution 100 | * 101 | * Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded. 102 | */ 103 | var currentWindowOnload = window.onload; 104 | 105 | window.onload = function() { 106 | if (currentWindowOnload) { 107 | currentWindowOnload(); 108 | } 109 | htmlReporter.initialize(); 110 | env.execute(); 111 | }; 112 | 113 | /** 114 | * Helper function for readability above. 115 | */ 116 | function extend(destination, source) { 117 | for (var property in source) destination[property] = source[property]; 118 | return destination; 119 | } 120 | 121 | }()); 122 | -------------------------------------------------------------------------------- /test/jasmine/lib/jasmine-2.3.4/console.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008-2015 Pivotal Labs 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | function getJasmineRequireObj() { 24 | if (typeof module !== 'undefined' && module.exports) { 25 | return exports; 26 | } else { 27 | window.jasmineRequire = window.jasmineRequire || {}; 28 | return window.jasmineRequire; 29 | } 30 | } 31 | 32 | getJasmineRequireObj().console = function(jRequire, j$) { 33 | j$.ConsoleReporter = jRequire.ConsoleReporter(); 34 | }; 35 | 36 | getJasmineRequireObj().ConsoleReporter = function() { 37 | 38 | var noopTimer = { 39 | start: function(){}, 40 | elapsed: function(){ return 0; } 41 | }; 42 | 43 | function ConsoleReporter(options) { 44 | var print = options.print, 45 | showColors = options.showColors || false, 46 | onComplete = options.onComplete || function() {}, 47 | timer = options.timer || noopTimer, 48 | specCount, 49 | failureCount, 50 | failedSpecs = [], 51 | pendingCount, 52 | ansi = { 53 | green: '\x1B[32m', 54 | red: '\x1B[31m', 55 | yellow: '\x1B[33m', 56 | none: '\x1B[0m' 57 | }, 58 | failedSuites = []; 59 | 60 | print('ConsoleReporter is deprecated and will be removed in a future version.'); 61 | 62 | this.jasmineStarted = function() { 63 | specCount = 0; 64 | failureCount = 0; 65 | pendingCount = 0; 66 | print('Started'); 67 | printNewline(); 68 | timer.start(); 69 | }; 70 | 71 | this.jasmineDone = function() { 72 | printNewline(); 73 | for (var i = 0; i < failedSpecs.length; i++) { 74 | specFailureDetails(failedSpecs[i]); 75 | } 76 | 77 | if(specCount > 0) { 78 | printNewline(); 79 | 80 | var specCounts = specCount + ' ' + plural('spec', specCount) + ', ' + 81 | failureCount + ' ' + plural('failure', failureCount); 82 | 83 | if (pendingCount) { 84 | specCounts += ', ' + pendingCount + ' pending ' + plural('spec', pendingCount); 85 | } 86 | 87 | print(specCounts); 88 | } else { 89 | print('No specs found'); 90 | } 91 | 92 | printNewline(); 93 | var seconds = timer.elapsed() / 1000; 94 | print('Finished in ' + seconds + ' ' + plural('second', seconds)); 95 | printNewline(); 96 | 97 | for(i = 0; i < failedSuites.length; i++) { 98 | suiteFailureDetails(failedSuites[i]); 99 | } 100 | 101 | onComplete(failureCount === 0); 102 | }; 103 | 104 | this.specDone = function(result) { 105 | specCount++; 106 | 107 | if (result.status == 'pending') { 108 | pendingCount++; 109 | print(colored('yellow', '*')); 110 | return; 111 | } 112 | 113 | if (result.status == 'passed') { 114 | print(colored('green', '.')); 115 | return; 116 | } 117 | 118 | if (result.status == 'failed') { 119 | failureCount++; 120 | failedSpecs.push(result); 121 | print(colored('red', 'F')); 122 | } 123 | }; 124 | 125 | this.suiteDone = function(result) { 126 | if (result.failedExpectations && result.failedExpectations.length > 0) { 127 | failureCount++; 128 | failedSuites.push(result); 129 | } 130 | }; 131 | 132 | return this; 133 | 134 | function printNewline() { 135 | print('\n'); 136 | } 137 | 138 | function colored(color, str) { 139 | return showColors ? (ansi[color] + str + ansi.none) : str; 140 | } 141 | 142 | function plural(str, count) { 143 | return count == 1 ? str : str + 's'; 144 | } 145 | 146 | function repeat(thing, times) { 147 | var arr = []; 148 | for (var i = 0; i < times; i++) { 149 | arr.push(thing); 150 | } 151 | return arr; 152 | } 153 | 154 | function indent(str, spaces) { 155 | var lines = (str || '').split('\n'); 156 | var newArr = []; 157 | for (var i = 0; i < lines.length; i++) { 158 | newArr.push(repeat(' ', spaces).join('') + lines[i]); 159 | } 160 | return newArr.join('\n'); 161 | } 162 | 163 | function specFailureDetails(result) { 164 | printNewline(); 165 | print(result.fullName); 166 | 167 | for (var i = 0; i < result.failedExpectations.length; i++) { 168 | var failedExpectation = result.failedExpectations[i]; 169 | printNewline(); 170 | print(indent(failedExpectation.message, 2)); 171 | print(indent(failedExpectation.stack, 2)); 172 | } 173 | 174 | printNewline(); 175 | } 176 | 177 | function suiteFailureDetails(result) { 178 | for (var i = 0; i < result.failedExpectations.length; i++) { 179 | printNewline(); 180 | print(colored('red', 'An error was thrown in an afterAll')); 181 | printNewline(); 182 | print(colored('red', 'AfterAll ' + result.failedExpectations[i].message)); 183 | 184 | } 185 | printNewline(); 186 | } 187 | } 188 | 189 | return ConsoleReporter; 190 | }; 191 | -------------------------------------------------------------------------------- /test/jasmine/lib/jasmine-2.3.4/jasmine_favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datejs/Datejs/56b945cf4ebb6b8eb6404c47697bd518e3d413b0/test/jasmine/lib/jasmine-2.3.4/jasmine_favicon.png -------------------------------------------------------------------------------- /test/jasmine/spec/PlayerSpec.js: -------------------------------------------------------------------------------- 1 | describe("Player", function() { 2 | var player; 3 | var song; 4 | 5 | beforeEach(function() { 6 | player = new Player(); 7 | song = new Song(); 8 | }); 9 | 10 | it("should be able to play a Song", function() { 11 | player.play(song); 12 | expect(player.currentlyPlayingSong).toEqual(song); 13 | 14 | //demonstrates use of custom matcher 15 | expect(player).toBePlaying(song); 16 | }); 17 | 18 | describe("when song has been paused", function() { 19 | beforeEach(function() { 20 | player.play(song); 21 | player.pause(); 22 | }); 23 | 24 | it("should indicate that the song is currently paused", function() { 25 | expect(player.isPlaying).toBeFalsy(); 26 | 27 | // demonstrates use of 'not' with a custom matcher 28 | expect(player).not.toBePlaying(song); 29 | }); 30 | 31 | it("should be possible to resume", function() { 32 | player.resume(); 33 | expect(player.isPlaying).toBeTruthy(); 34 | expect(player.currentlyPlayingSong).toEqual(song); 35 | }); 36 | }); 37 | 38 | // demonstrates use of spies to intercept and test method calls 39 | it("tells the current song if the user has made it a favorite", function() { 40 | spyOn(song, 'persistFavoriteStatus'); 41 | 42 | player.play(song); 43 | player.makeFavorite(); 44 | 45 | expect(song.persistFavoriteStatus).toHaveBeenCalledWith(true); 46 | }); 47 | 48 | //demonstrates use of expected exceptions 49 | describe("#resume", function() { 50 | it("should throw an exception if song is already playing", function() { 51 | player.play(song); 52 | 53 | expect(function() { 54 | player.resume(); 55 | }).toThrowError("song is already playing"); 56 | }); 57 | }); 58 | }); 59 | -------------------------------------------------------------------------------- /test/jasmine/spec/SpecHelper.js: -------------------------------------------------------------------------------- 1 | beforeEach(function () { 2 | jasmine.addMatchers({ 3 | toBePlaying: function () { 4 | return { 5 | compare: function (actual, expected) { 6 | var player = actual; 7 | 8 | return { 9 | pass: player.currentlyPlayingSong === expected && player.isPlaying 10 | }; 11 | } 12 | }; 13 | } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /test/jasmine/src/Player.js: -------------------------------------------------------------------------------- 1 | function Player() { 2 | } 3 | Player.prototype.play = function(song) { 4 | this.currentlyPlayingSong = song; 5 | this.isPlaying = true; 6 | }; 7 | 8 | Player.prototype.pause = function() { 9 | this.isPlaying = false; 10 | }; 11 | 12 | Player.prototype.resume = function() { 13 | if (this.isPlaying) { 14 | throw new Error("song is already playing"); 15 | } 16 | 17 | this.isPlaying = true; 18 | }; 19 | 20 | Player.prototype.makeFavorite = function() { 21 | this.currentlyPlayingSong.persistFavoriteStatus(true); 22 | }; -------------------------------------------------------------------------------- /test/jasmine/src/Song.js: -------------------------------------------------------------------------------- 1 | function Song() { 2 | } 3 | 4 | Song.prototype.persistFavoriteStatus = function(value) { 5 | // something complicated 6 | throw new Error("not yet implemented"); 7 | }; -------------------------------------------------------------------------------- /test/parseExact/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : parseExact 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 |

parseExact

34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /test/parseExact/index.js: -------------------------------------------------------------------------------- 1 | if(typeof require !== 'undefined') { 2 | var Specification = require('../scripts/specification-converter.js'); 3 | } 4 | 5 | 6 | Date.Specification = new Specification({ 7 | 'Specific Format': { 8 | setup: function() { 9 | this.baseline = new Date(2004,6,1); 10 | this.baseline2 = new Date(2004,6,15); 11 | }, 12 | '2008/1/1 : "yyyy/M/d"': { 13 | run: function() { this.date = Date.parseExact('2008/1/1', "yyyy/M/d") }, 14 | assert: function() { return new Date(2008, 0, 1).equals(this.date) } 15 | }, 16 | '2008/1/5 : "yyyy/M/d"': { 17 | run: function() { this.date = Date.parseExact('2008/1/5', "yyyy/M/d") }, 18 | assert: function() { return new Date(2008, 0, 5).equals(this.date) } 19 | }, 20 | '2008/1/31 : "yyyy/M/d"': { 21 | run: function() { this.date = Date.parseExact('2008/1/31', "yyyy/M/d") }, 22 | assert: function() { return new Date(2008, 0, 31).equals(this.date) } 23 | }, 24 | '04/07/15 : "yy/MM/dd"': { 25 | run: function() { this.date = Date.parseExact('04/07/15', "yy/MM/dd" ) }, 26 | assert: function() { return this.baseline2.equals( this.date ) } 27 | }, 28 | '04/7/15 : "yy/M/d"': { 29 | run: function() { this.date = Date.parseExact('04/7/15', "yy/M/d" ) }, 30 | assert: function() { return this.baseline2.equals( this.date ) } 31 | }, 32 | '2004/1/7 : "yyyy/d/M"': { 33 | run: function() { this.date = Date.parseExact('2004/1/7', "yyyy/d/M" ) }, 34 | assert: function() { return this.baseline.equals( this.date ) } 35 | }, 36 | '2004/01/07 : "yyyy/dd/MM"': { 37 | run: function() { this.date = Date.parseExact('2004/01/07', "yyyy/dd/MM" ) }, 38 | assert: function() { return this.baseline.equals( this.date ) } 39 | }, 40 | '04/01/07 : "yy/dd/MM"': { 41 | run: function() { this.date = Date.parseExact('04/01/07', "yy/dd/MM" ) }, 42 | assert: function() { return this.baseline.equals( this.date ) } 43 | }, 44 | '04/1/7 : "yy/d/M"': { 45 | run: function() { this.date = Date.parseExact('04/1/7', "yy/d/M" ) }, 46 | assert: function() { return this.baseline.equals( this.date ) } 47 | }, 48 | '2004/15/7 : "yyyy/d/M"': { 49 | run: function() { this.date = Date.parseExact('2004/15/7', "yyyy/d/M" ) }, 50 | assert: function() { return this.baseline2.equals( this.date ) } 51 | }, 52 | '2004/15/07 : "yyyy/dd/MM"': { 53 | run: function() { this.date = Date.parseExact('2004/15/07', "yyyy/dd/MM" ) }, 54 | assert: function() { return this.baseline2.equals( this.date ) } 55 | }, 56 | '04/15/07 : "yy/dd/MM"': { 57 | run: function() { this.date = Date.parseExact('04/15/07', "yy/dd/MM" ) }, 58 | assert: function() { return this.baseline2.equals( this.date ) } 59 | }, 60 | '04/15/7 : "yy/d/M"': { 61 | run: function() { this.date = Date.parseExact('04/15/7', "yy/d/M" ) }, 62 | assert: function() { return this.baseline2.equals( this.date ) } 63 | }, 64 | '1/7/2004 : "d/M/yyyy"': { 65 | run: function() { this.date = Date.parseExact('1/7/2004', 'd/M/yyyy' ) }, 66 | assert: function() { return this.baseline.equals( this.date ) } 67 | }, 68 | '01/07/2004 : "dd/MM/yyyy"': { 69 | run: function() { this.date = Date.parseExact('01/07/2004', 'dd/MM/yyyy' ) }, 70 | assert: function() { return this.baseline.equals( this.date ) } 71 | }, 72 | '01/07/04 : "dd/MM/yy"': { 73 | run: function() { this.date = Date.parseExact('01/07/04', 'dd/MM/yy' ) }, 74 | assert: function() { return this.baseline.equals( this.date ) } 75 | }, 76 | '15/7/2004 : "d/M/yyyy"': { 77 | run: function() { this.date = Date.parseExact('15/7/2004', 'd/M/yyyy' ) }, 78 | assert: function() { return this.baseline2.equals( this.date ) } 79 | }, 80 | '15/07/2004 : "d/M/yyyy"': { 81 | run: function() { this.date = Date.parseExact('15/07/2004', 'd/M/yyyy' ) }, 82 | assert: function() { return this.baseline2.equals( this.date ) } 83 | }, 84 | '15/07/04 : "d/MM/yy"': { 85 | run: function() { this.date = Date.parseExact('15/07/04', 'd/MM/yy' ) }, 86 | assert: function() { return this.baseline2.equals( this.date ) } 87 | }, 88 | '2004 : "yyyy"': { 89 | run: function() { this.date = Date.parseExact('2004', 'yyyy' ) }, 90 | assert: function() { return Date.today().set({ year: 2004, day: 1 }).equals( this.date ) } 91 | }, 92 | 'July 2004 : "MMMM, yyyy"': { 93 | run: function() { this.date = Date.parseExact('July 2004', 'MMMM yyyy') }, 94 | assert: function() { 95 | return new Date(2004, 6, 1).equals( this.date ); 96 | } 97 | }, 98 | 'March 15, 2004 : "MMMM d, yyyy"': { 99 | run: function() { this.date = Date.parseExact('March 15, 2004', 'MMMM d, yyyy') }, 100 | assert: function() { 101 | return new Date(2004, 2, 15).equals( this.date ); 102 | } 103 | }, 104 | '00:15 pm : "hh:mm tt"': { 105 | run: function() { this.date = Date.parseExact('00:15 pm', 'hh:mm tt').set({millisecond: 0, second: 0}) }, 106 | assert: function() { 107 | return new Date().set({millisecond: 0, hour: 0, minute: 15, second: 0}).equals(this.date); 108 | } 109 | }, 110 | '12:15 am : "hh:mm tt"': { 111 | run: function() { this.date = Date.parseExact('12:15 am', 'hh:mm tt').set({millisecond: 0, second: 0}) }, 112 | assert: function() { 113 | return new Date().set({millisecond: 0, hour: 0, minute: 15, second: 0}).equals(this.date); 114 | } 115 | }, 116 | '12:15 pm : "hh:mm tt"': { 117 | run: function() { this.date = Date.parseExact('12:15 pm', 'hh:mm tt').set({millisecond: 0, second: 0}) }, 118 | assert: function() { 119 | return new Date().set({millisecond: 0, hour: 12, minute: 15, second: 0}).equals(this.date); 120 | } 121 | } 122 | } 123 | }); 124 | 125 | -------------------------------------------------------------------------------- /test/partial/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : Partial 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 |

Partial

34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /test/performance/bulk.css: -------------------------------------------------------------------------------- 1 | * { margin:0; padding: 0; font-size: 12pt; font-family: verdana;} 2 | body { margin:20px;} 3 | h1 { font-size: 18pt; } 4 | h1, h2, h3, p { margin-bottom: 20px; } 5 | #chart { border: 1px solid gray; padding: 10px;} 6 | #chart div.bar { height: 60px; padding: 10px;} 7 | #chart div.bar label { display: block; float: left; clear: both; width: 340px; 8 | margin: 20px; text-align: right;} 9 | #chart div.bar div.value { float: left; height: 30px; background-color: green; margin: 15px; } 10 | #chart div.bar div.display { float: left; font-size: 10pt; margin: 20px; } 11 | -------------------------------------------------------------------------------- /test/performance/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bulk Performance Tests 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |

Performance Timings

31 |

Using random dates with format "M/d/yyyy".

32 |
33 | 34 | 35 | -------------------------------------------------------------------------------- /test/performance/index.js: -------------------------------------------------------------------------------- 1 | var benchmark = function( fn ) { 2 | var start = new Date(); fn(); var end = new Date(); 3 | return end - start; 4 | }; 5 | 6 | var micro_benchmark = function( fn ) { 7 | var x = 0; for( var i = 0; i < 1000; i++ ) { x+=benchmark(fn); }; return x; 8 | }; 9 | 10 | var dateBenchmark = function( tests, fn ) { 11 | var month, day, year; var time = 0; 12 | for ( var i = 0 ; i < tests ; i++ ) { 13 | month = Math.round( Math.random() * 11 ); 14 | day = Math.round( Math.random() * 27 ) + 1; 15 | year = Math.round( Math.random() * 10 ) + 1995; 16 | var s = month.toString()+'/'+day.toString()+'/'+year.toString(); 17 | time += benchmark( function() { fn(s) } ); 18 | } 19 | return (Math.round(time/tests*1000)); 20 | }; 21 | 22 | $(document).ready(function() { 23 | var tests = 250; 24 | var results = { 25 | 'Native: .parse': dateBenchmark( tests, Date._parse ), 26 | 'Ext: parseDate': dateBenchmark( tests, function(s) { Date.parseDate( s, 'm/d/Y' ); } ), 27 | 'Datejs: .parseExact': dateBenchmark( tests, function(s) { Date.parseExact( s, 'M/d/yyyy' ); } ), 28 | 'Datejs: .getParseFunction': dateBenchmark( tests, Date.getParseFunction('M/d/yyyy') ), 29 | 'Datejs: .parse': dateBenchmark( tests, Date.parse ) 30 | }; 31 | var max = 0; for ( var k in results ) { max = ( max < results[k] ) ? results[k]:max ; } 32 | var addResult = function(h, r) { $('#chart').append( 33 | '
' + 34 | ''+ 35 | '
' + 36 | '
'+r+' microseconds
'); 37 | }; 38 | for ( var k in results ) { addResult( k, results[k]); } 39 | }); -------------------------------------------------------------------------------- /test/relative/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : Relative 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 |

Relative

34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /test/relative_date_and_time/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : Relative Date and Time 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 |

Relative Date and Time

34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /test/rememberthemilk/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : RememberTheMilk 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 |

RememberTheMilk

34 |

Comparison support for rememberthemilk.com date and time input formats. See RTM FAQ

35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /test/rememberthemilk/index.js: -------------------------------------------------------------------------------- 1 | if(typeof require !== 'undefined') { 2 | var Specification = require('../scripts/specification-converter.js'); 3 | } 4 | 5 | 6 | Date.Specification = new Specification({ 7 | 'RememberTheMilk': { 8 | setup: function() { 9 | this.now = new Date(); 10 | this.now.setMilliseconds(0); 11 | }, 12 | 'today': { 13 | run: function() { }, 14 | assert: function() { return Date.today().equals( Date.parse('today') ) } 15 | }, 16 | 'tod': { 17 | run: function() { }, 18 | assert: function() { return Date.today().equals( Date.parse('tod') ) } 19 | }, 20 | 'tomorrow': { 21 | run: function() { }, 22 | assert: function() { return Date.today().add(1).day().equals( Date.parse('tomorrow') ) } 23 | }, 24 | 'tom': { 25 | run: function() { }, 26 | assert: function() { return Date.today().add(1).day().equals( Date.parse('tom') ) } 27 | }, 28 | '25 Apr': { 29 | run: function() { }, 30 | assert: function() { return Date.april().set({ day: 25 }).equals( Date.parse('25 Apr') ) } 31 | }, 32 | 'Apr 25': { 33 | run: function() { }, 34 | assert: function() { return Date.april().set({ day: 25 }).equals( Date.parse('Apr 25') ) } 35 | }, 36 | '04/25/2007': { 37 | run: function() { }, 38 | assert: function() { return new Date(2007,3,25).equals( Date.parse('04/25/2007') ) } 39 | }, 40 | '25/04/2007': { 41 | run: function() { }, 42 | assert: function() { return new Date(2007,3,25).equals( Date.parse('25/04/2007') ) } 43 | }, 44 | '2006/04/25': { 45 | run: function() { }, 46 | assert: function() { return new Date(2006,3,25).equals( Date.parse('2006/04/25') ) } 47 | }, 48 | '2006-04-25': { 49 | run: function() { }, 50 | assert: function() { return new Date(2006,3,25).equals( Date.parse('2006-04-25') ) } 51 | }, 52 | '25th': { 53 | run: function() { }, 54 | assert: function() { return Date.today().set({ day: 25 }).equals( Date.parse('25th') ) } 55 | }, 56 | 'Friday': { 57 | run: function() { }, 58 | assert: function() { return Date.friday().equals( Date.parse('Friday') ) } 59 | }, 60 | 'Next Friday': { 61 | run: function() { }, 62 | assert: function() { return Date.today().next().friday().equals( Date.parse('Next Friday') ) } 63 | }, 64 | 'Fri at 7pm': { 65 | run: function() { }, 66 | assert: function() { return Date.fri().set({ hour: 19 }).equals( Date.parse('Fri at 7pm') ) } 67 | }, 68 | 'Fri @ 7pm': { 69 | run: function() { }, 70 | assert: function() { return Date.fri().set({ hour: 19 }).equals( Date.parse('Fri @ 7pm') ) } 71 | }, 72 | '6pm': { 73 | run: function() { }, 74 | assert: function() { return Date.today().set({ hour: 18 }).equals( Date.parse('6pm') ) } 75 | }, 76 | '18:00': { 77 | run: function() { }, 78 | assert: function() { return Date.today().set({ hour: 18 }).equals( Date.parse('18:00') ) } 79 | }, 80 | '5 hours': { 81 | run: function() { 82 | this.date = Date.parse('5 hours'); 83 | this.date.setMilliseconds(0); 84 | }, 85 | assert: function() { return this.now.add(5).hours().equals( this.date ) } 86 | }, 87 | '2 days': { 88 | run: function() { 89 | this.date = Date.parse('2 days'); 90 | this.date.setMilliseconds(0); 91 | }, 92 | assert: function() { return Date.today().add(2).days().equals( this.date ) } 93 | }, 94 | 95 | }, 96 | "Fail: Differences between RememberTheMilk and Date.js": { 97 | '3 weeks : Datejs uses "+3 weeks."': { 98 | run: function() { 99 | this.date = Date.parse('3 weeks'); 100 | this.date.setMilliseconds(0); 101 | }, 102 | assert: function() { return Date.today().add(3).weeks().equals( this.date ) } 103 | }, 104 | 'End of month : Not supported currently.': { 105 | run: function() { }, 106 | assert: function() { return Date.today().moveToLastDayOfMonth().equals( Date.parse('End of month') ) } 107 | }, 108 | } 109 | }); 110 | 111 | -------------------------------------------------------------------------------- /test/ruby_chronic/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : Ruby Chronic Comparison 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 |

Ruby Chronic Comparison

34 |

Comparison support for Ruby Chronic.com date and time input formats.

35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /test/scripts/cruiser.js: -------------------------------------------------------------------------------- 1 | var Cruiser = { 2 | About: { 3 | Description : 'Javascript framework ', 4 | Author : 'Dan Yoder', 5 | Version : { major: '0', minor: '4' }, 6 | Notices : { Copyright: '(c) 2007 Dan Yoder' }, 7 | License : 'Cruiser is freely distributable under the terms of the MIT license.', 8 | URL : 'http://dev.zeraweb.com/cruiser/' 9 | } 10 | } 11 | var Module = function(m) { 12 | if (m) { 13 | for( var k in Module.prototype ) { m[k] = Module.prototype[k] }; return m; 14 | } else { return this } 15 | }; 16 | Module.prototype = { 17 | extend: function(m) { for( var k in m ) { this.prototype[k] = m[k] }; return this; } 18 | }; 19 | Cruiser.String = { 20 | lstrip: function() { return this.replace(/^\s*/,'') }, 21 | rstrip: function() { return this.replace(/\s*$/,'') }, 22 | strip: function() { return this.lstrip().rstrip() }, 23 | map: function( args, f ) { 24 | var g = function( s, p ) { return f.apply( s, p ); } 25 | return args.inject( this, g ); 26 | }, 27 | toCharArray: String.prototype.toArray, 28 | toArray: function( separator ) { 29 | if ( separator ) { 30 | var f = function( s ) { return s.blank() ? null : s.strip() }; 31 | return this.split( separator || ',' ).map( f ); 32 | } else { return this.toCharArray() } 33 | } 34 | }; 35 | Module( String ).extend( Cruiser.String ); 36 | -------------------------------------------------------------------------------- /test/scripts/debugging.js: -------------------------------------------------------------------------------- 1 | var _ = Date.Parsing.Operators, G = Date.Grammar, T = Date.Translator; 2 | 3 | var _test = function(r, s, x, y) { 4 | var rx; 5 | x = x||{}; 6 | y = y||{}; 7 | 8 | var start = Date.now(); 9 | 10 | try { 11 | rx = r.call( x, s ); 12 | } catch(e) { 13 | console.log(e); 14 | } 15 | 16 | var finish = new Date(); 17 | 18 | if ( rx[0] instanceof Array ) { 19 | rx[0].flatten().compact().each( function( fn ) { fn.call( y ); } ); 20 | } else if ( rx[0] instanceof Function ) { 21 | rx[0].call(y); 22 | } 23 | 24 | if ( rx[1].length ) { 25 | console.log("Failed to parse: '" + rx[1] + "'."); 26 | } 27 | 28 | console.log("Ran in " + (finish-start) + "ms."); 29 | 30 | console.log(y); 31 | }; -------------------------------------------------------------------------------- /test/scripts/enumerable.js: -------------------------------------------------------------------------------- 1 | var Hash = function(object) { 2 | if (object) { 3 | for(var k in object) { if (!(typeof this[k]=='function')) { this[k] = object[k] } } 4 | } 5 | }; 6 | Hash.convert = function(object) { 7 | for( var k in Hash.prototype ) { object[k] = Hash.prototype[k] }; return object; 8 | }; 9 | Hash.prototype = { 10 | each: function( fn ) { 11 | for( var k in this ) { 12 | if (! ( typeof this[k] == 'function' )) { fn({0:k, 1: this[k], key: k, value: this[k]}) } 13 | } 14 | return this; 15 | }, 16 | merge: function( hash ) { 17 | var self = this; 18 | new Hash(hash).each( function(item) { self[item.key] = item.value }); return this; 19 | } 20 | }; 21 | Array.convert = function(object) { 22 | if (object instanceof Array ) { return object } 23 | else if (object.toArray) { return object.toArray() } 24 | else { 25 | var rval = []; for(var i = 0; i 3 | 4 | 5 | 6 | 7 | Firebug 8 | 9 | 10 | 11 | 12 |
13 | Clear 14 | 15 | Close 16 | 17 |
18 |
19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/scripts/firebug/firebugx.js: -------------------------------------------------------------------------------- 1 | 2 | if (!("console" in window) || !("firebug" in console)) 3 | { 4 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", 5 | "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; 6 | 7 | window.console = {}; 8 | for (var i = 0; i < names.length; ++i) 9 | window.console[names[i]] = function() {} 10 | } -------------------------------------------------------------------------------- /test/scripts/firebug/infoIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datejs/Datejs/56b945cf4ebb6b8eb6404c47697bd518e3d413b0/test/scripts/firebug/infoIcon.png -------------------------------------------------------------------------------- /test/scripts/firebug/warningIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/datejs/Datejs/56b945cf4ebb6b8eb6404c47697bd518e3d413b0/test/scripts/firebug/warningIcon.png -------------------------------------------------------------------------------- /test/scripts/specification-converter.js: -------------------------------------------------------------------------------- 1 | // convert cruiser.js Specification objects to jasmine tests 2 | (function(){ 3 | 4 | var exp; 5 | 6 | 7 | 8 | function Specification(spec) { 9 | for(suite in spec) { 10 | describe(suite, function(){ 11 | if(spec[suite].setup) { 12 | beforeEach(spec[suite].setup); 13 | } 14 | 15 | for(test in spec[suite]) { 16 | if(test !== 'setup' && spec[suite].hasOwnProperty(test)) { 17 | //embed in an IIFE so that the same test doesn't get run over and over 18 | (function(s,testJig){ 19 | it(test, function(){ 20 | //apply is used to ensure that run and assert get the same contexts 21 | testJig.run.call(this); 22 | 23 | if(testJig.expect) { 24 | testJig.expect.call(this,expect); 25 | } else { 26 | 27 | if(s.length > 3 && s.substring(0,4) === 'Fail') { 28 | expect(testJig.assert.call(this)).toBe(false); 29 | } else { 30 | expect(testJig.assert.call(this)).toBe(true); 31 | } 32 | } 33 | 34 | }) 35 | })(suite,spec[suite][test]); 36 | } 37 | } 38 | }) 39 | } 40 | } 41 | 42 | if(typeof module !== 'undefined') { 43 | module.exports = Specification; 44 | } else { 45 | window.Specification = Specification; 46 | } 47 | 48 | })(); 49 | 50 | 51 | -------------------------------------------------------------------------------- /test/scripts/specifications.js: -------------------------------------------------------------------------------- 1 | Cruiser.Specification = {}; 2 | Cruiser.Specification.About = { 3 | Description : 'Javascript library for Behavior Driven Design (BDD)', 4 | Author : 'Dan Yoder', 5 | Version : { major: '0', minor: '5' }, 6 | Notices : { Copyright: '(c) 2007 Dan Yoder' }, 7 | License : 'Specification is freely distributable under the terms of the MIT license.', 8 | URL : 'http://dev.zeraweb.com/specifications/' 9 | }; 10 | 11 | Specification = function(spec) { this.spec = new Hash( spec ); } 12 | 13 | Specification.prototype = { 14 | validate: function() { 15 | var result = this.spec.inject( 16 | new Specification.Result(), Specification.Context.validate ); 17 | return result; 18 | }, 19 | 20 | run: function() { 21 | this.validate().show(); 22 | } 23 | } 24 | Specification.Context = { 25 | validate: function(r,c) { 26 | var name = c[0], spec = new Hash(c[1]); spec.results = new Hash(); 27 | r.data[name] = spec.inject( spec, Specification.Test.run ).results; 28 | return r; 29 | } 30 | } 31 | Specification.Test = { 32 | run: function(r,c) { 33 | var name = c[0], test = c[1], time = 0, start = null; 34 | switch(name) { 35 | case 'results': 36 | case 'setup': 37 | case 'teardown': 38 | return r; 39 | } 40 | 41 | var object = {}; 42 | 43 | try { 44 | if (r.setup) { 45 | r.setup.call(object); 46 | } 47 | 48 | if (test.run) { 49 | start = new Date(); 50 | test.run.call(object); 51 | time = (new Date()) - start; 52 | } 53 | 54 | if (test.assert) { 55 | r.results[name] = test.assert.call(object, Specification.Assert ); 56 | } 57 | 58 | if (r.teardown) { 59 | r.teardown.call(object); 60 | } 61 | } 62 | catch(e) { 63 | time = (new Date()) - start ; 64 | r.results[name] = false; 65 | } 66 | 67 | return r; 68 | } 69 | } 70 | Specification.Assert = { 71 | isTrue: function() { 72 | return Array.convert( arguments ).inject( true, 73 | function(r,a) { return ( ( r && a ) ? true : false ) }); 74 | } 75 | } 76 | Specification.Result = function() { this.data = new Hash() }; 77 | 78 | Specification.Result.setOutput = function(e) { Specification.Result.output = e }; 79 | 80 | Specification.Result.prototype = { 81 | show: function() { 82 | var r = Specification.Result; 83 | 84 | if ( !r.output ) { 85 | r.output = $('div.results'); 86 | } 87 | 88 | var addContext = function(ctx) { 89 | return '

' + ctx[0] + '

' + 90 | '' + ctx[1].map( addTest ).join('\n') + '
'; 91 | } 92 | 93 | var addTest = function(test) { 94 | var status = test[1] ? "pass" : "fail"; 95 | return '' + test[0] + ' '; 96 | 97 | // with new testItem object 98 | // Sample testItem object 99 | // test = { id: 34, name: "Random Curve ball", value: "7-8, '04", result: true, time: 5 }; 100 | // return '' + test.id + '' + test.value + '' + test.name + '' + test.time + ''; 101 | } 102 | 103 | r.output.append( this.data.map( addContext ).join('\n') ); 104 | } 105 | } -------------------------------------------------------------------------------- /test/scripts/specifications_original.js: -------------------------------------------------------------------------------- 1 | Cruiser.Specification = {} 2 | Cruiser.Specification.About = { 3 | Description : 'Javascript library for Behavior Driven Design (BDD)', 4 | Author : 'Dan Yoder', 5 | Version : { major: '0', minor: '5' }, 6 | Notices : { Copyright: '(c) 2007 Dan Yoder' }, 7 | License : 'Specification is freely distributable under the terms of the MIT license.', 8 | URL : 'http://dev.zeraweb.com/specifications/' 9 | } 10 | Specification = function(spec) { this.spec = new Hash( spec ); } 11 | Specification.log = function(msg,tag) { 12 | $('div.log').append("<"+(tag||'p')+" class='message'>"+msg+""); 13 | } 14 | Specification.prototype = { 15 | validate: function() { 16 | Specification.log('Processing ...'); 17 | var start = new Date(); 18 | var result = this.spec.inject( 19 | new Specification.Result(), Specification.Context.validate ); 20 | var end = new Date(); 21 | Specification.log('Processing Time','h1'); 22 | Specification.log('Finished processing in ' + (end-start) + ' ms.'); 23 | return result; 24 | }, 25 | run: function() { this.validate().show() } 26 | } 27 | Specification.Context = { 28 | validate: function(r,c) { 29 | var name = c[0], spec = new Hash(c[1]); spec.results = new Hash(); 30 | Specification.log(name,'h2'); 31 | r.data[name] = spec.inject( spec, Specification.Test.run ).results; 32 | return r; 33 | } 34 | } 35 | Specification.Test = { 36 | run: function(r,c) { 37 | var name = c[0], test = c[1], time = 0, start = null; 38 | switch(name) { case 'results': case 'setup': case 'teardown': return r; } 39 | Specification.log(name,'p'); var object = {}; 40 | try { 41 | if (r.setup) { r.setup.call(object); } 42 | if (test.run) { start = new Date(); test.run.call(object); time = (new Date()) - start } 43 | if (test.assert) { r.results[name] = test.assert.call(object, Specification.Assert ) } 44 | if (r.teardown) { r.teardown.call(object) } 45 | } catch(e) { time = (new Date()) - start ; Specification.log(e); r.results[name] = false } 46 | Specification.log('Ran in '+time+' ms.','p'); 47 | return r; 48 | } 49 | } 50 | Specification.Assert = { 51 | isTrue: function() { 52 | return Array.convert( arguments ).inject( true, 53 | function(r,a) { return ( ( r && a ) ? true : false ) }); 54 | } 55 | } 56 | Specification.Result = function() { this.data = new Hash() }; 57 | Specification.Result.setOutput = function(e) { Specification.Result.output = e }; 58 | Specification.Result.prototype = { 59 | show: function() { 60 | Specification.log("Displaying results ...",'p'); 61 | var r = Specification.Result, start = new Date(); 62 | if ( ! r.output ) { r.output = $('div.results') } 63 | var addContext = function(ctx) { 64 | return "

"+ctx[0]+"

"+ 65 | "
"+ctx[1].map( addTest ).join('\n')+"
"; 66 | } 67 | var addTest = function(test) { 68 | var status = test[1]?'pass':'fail'; 69 | return "
" + 70 | "
"+test[0]+"
"+ 71 | "
"+status+"
"; 72 | } 73 | r.output.append( this.data.map( addContext ).join('\n') ); 74 | var end = new Date(); 75 | Specification.log("Results displayed in " + (end-start) + " ms.",'p'); 76 | } 77 | } -------------------------------------------------------------------------------- /test/styles/chart.css: -------------------------------------------------------------------------------- 1 | #chart 2 | { 3 | padding: 10px; 4 | } 5 | 6 | #chart div.item 7 | { 8 | height: 18px; 9 | padding: 4px; 10 | } 11 | 12 | #chart div.item label 13 | { 14 | display: block; 15 | float: left; 16 | clear: both; 17 | width: 200px; 18 | text-align: right; 19 | } 20 | 21 | #chart div.item div.bar 22 | { 23 | float: left; 24 | height: 18px; 25 | background-color: #72C868; 26 | margin: 0 15px; 27 | } 28 | 29 | #chart div.item div.display 30 | { 31 | float: left; 32 | } 33 | -------------------------------------------------------------------------------- /test/styles/specifications.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 5px 20px; 3 | font-family: Verdana, Helvetica, Arial, Sans-serif; 4 | color: #333; 5 | font-size: 10pt; 6 | } 7 | 8 | body, li, a, label, div, table, th, td { 9 | font-size: 10pt; 10 | font-family: Verdana, Helvetica, Arial, Sans-serif; 11 | } 12 | 13 | li { 14 | margin-bottom: 4px; 15 | } 16 | 17 | .information { 18 | border: 1px solid #729ECD; 19 | padding: 4px; 20 | padding-left: 30px; 21 | background: #E6EEF7 url(../images/information.png) no-repeat 6px 12px; 22 | margin: 12px 0; 23 | } 24 | 25 | h1 { 26 | font-size: 18pt; 27 | } 28 | 29 | h2 { 30 | padding-top: 8px; 31 | font-size: 14pt; 32 | clear: both; 33 | } 34 | 35 | table.test { 36 | width: 800px; 37 | } 38 | 39 | table.test th { 40 | width: 700px; 41 | font-weight: normal; 42 | text-align: left; 43 | padding: 4px; 44 | padding-left: 30px; 45 | } 46 | 47 | table.test td { 48 | padding: 4px; 49 | } 50 | 51 | tr.pass th { 52 | border: 1px solid #72C868; 53 | background: #E9FFDD url(../images/accept.png) no-repeat 6px 4px ; 54 | } 55 | 56 | tr.pass td { 57 | border: 1px solid #72C868; 58 | background-color: #E9FFDD; 59 | } 60 | 61 | tr.fail th { 62 | border: 1px solid #F58263; 63 | background: #FEEBE7 url(../images/exclamation.png) no-repeat 6px 4px ; 64 | } 65 | 66 | tr.fail td { 67 | border: 1px solid #F58263; 68 | background-color: #FEEBE7; 69 | } -------------------------------------------------------------------------------- /test/sugarpak/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : Sugarpak Library 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 |

Sugarpak

35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /test/sugarpak/index.js: -------------------------------------------------------------------------------- 1 | if(typeof require !== 'undefined') { 2 | var Specification = require('../scripts/specification-converter.js'); 3 | } 4 | 5 | 6 | Date.Specification = new Specification({ 7 | 8 | 'Need more sugarpak.js tests?': { 9 | setup: function() {}, 10 | 'true': { 11 | run: function() { }, 12 | assert: function() { 13 | return true; 14 | } 15 | } 16 | }, 17 | 18 | 19 | '.same()': { 20 | setup: function() {}, 21 | 'same year(Date.today())': { 22 | run: function() { }, 23 | assert: function() { 24 | return Date.today().same().year(); 25 | } 26 | }, 27 | 'same month(Date.today())': { 28 | run: function() { }, 29 | assert: function() { 30 | return Date.today().same().month(); 31 | } 32 | }, 33 | 'same week(Date.today())': { 34 | run: function() { }, 35 | assert: function() { 36 | return Date.today().same().week(); 37 | } 38 | }, 39 | 'same day(Date.today())': { 40 | run: function() { }, 41 | assert: function() { 42 | return Date.today().same().day(); 43 | } 44 | }, 45 | 'same hour(Date.today())': { 46 | run: function() { }, 47 | assert: function() { 48 | return !Date.today().same().hour(); 49 | } 50 | }, 51 | 'same minute(Date.today())': { 52 | run: function() { }, 53 | assert: function() { 54 | return !Date.today().same().minute(); 55 | } 56 | }, 57 | 'same second(Date.today())': { 58 | run: function() { }, 59 | assert: function() { 60 | return !Date.today().same().second(); 61 | } 62 | }, 63 | 'same millisecond(Date.today())': { 64 | run: function() { }, 65 | assert: function() { 66 | return !Date.today().same().millisecond(); 67 | } 68 | }, 69 | 'same year(new Date())': { 70 | run: function() { }, 71 | assert: function() { 72 | return new Date().same().year(); 73 | } 74 | }, 75 | 'same month(new Date())': { 76 | run: function() { }, 77 | assert: function() { 78 | return new Date().same().month(); 79 | } 80 | }, 81 | 'same week(new Date())': { 82 | run: function() { }, 83 | assert: function() { 84 | return new Date().same().week(); 85 | } 86 | }, 87 | 'same day(new Date())': { 88 | run: function() { }, 89 | assert: function() { 90 | return new Date().same().day(); 91 | } 92 | }, 93 | 'same hour(new Date())': { 94 | run: function() { }, 95 | assert: function() { 96 | return new Date().same().hour(); 97 | } 98 | }, 99 | 'same minute(new Date())': { 100 | run: function() { }, 101 | assert: function() { 102 | return new Date().same().minute(); 103 | } 104 | }, 105 | 'same second(new Date())': { 106 | run: function() { }, 107 | assert: function() { 108 | return new Date().same().second(); 109 | } 110 | }, 111 | 'same millisecond(new Date())': { 112 | run: function() { }, 113 | assert: function() { 114 | return new Date().same().millisecond(); 115 | } 116 | }, 117 | 118 | 119 | 120 | 'same year2(Date.today())': { 121 | run: function() { }, 122 | assert: function() { 123 | return Date.today().same().year(Date.today()); 124 | } 125 | }, 126 | 'same month2(Date.today())': { 127 | run: function() { }, 128 | assert: function() { 129 | return Date.today().same().month(Date.today()); 130 | } 131 | }, 132 | 'same week2(Date.today())': { 133 | run: function() { }, 134 | assert: function() { 135 | return Date.today().same().week(Date.today()); 136 | } 137 | }, 138 | 'same day2(Date.today())': { 139 | run: function() { }, 140 | assert: function() { 141 | return Date.today().same().day(Date.today()); 142 | } 143 | }, 144 | 'same hour2(Date.today())': { 145 | run: function() { }, 146 | assert: function() { 147 | return Date.today().same().hour(Date.today()); 148 | } 149 | }, 150 | 'same minute2(Date.today())': { 151 | run: function() { }, 152 | assert: function() { 153 | return Date.today().same().minute(Date.today()); 154 | } 155 | }, 156 | 'same second2(Date.today())': { 157 | run: function() { }, 158 | assert: function() { 159 | return Date.today().same().second(Date.today()); 160 | } 161 | }, 162 | 'same millisecond2(Date.today())': { 163 | run: function() { }, 164 | assert: function() { 165 | return Date.today().same().millisecond(Date.today()); 166 | } 167 | }, 168 | 169 | 170 | 171 | 'same year2(new Date())': { 172 | run: function() { }, 173 | assert: function() { 174 | return Date.today().same().year(new Date()); 175 | } 176 | }, 177 | 'same month2(new Date())': { 178 | run: function() { }, 179 | assert: function() { 180 | return Date.today().same().month(new Date()); 181 | } 182 | }, 183 | 'same week2(new Date())': { 184 | run: function() { }, 185 | assert: function() { 186 | return Date.today().same().week(new Date()); 187 | } 188 | }, 189 | 'same day2(new Date())': { 190 | run: function() { }, 191 | assert: function() { 192 | return Date.today().same().day(new Date()); 193 | } 194 | }, 195 | 'same hour2(new Date())': { 196 | run: function() { }, 197 | assert: function() { 198 | return !Date.today().same().hour(new Date()); 199 | } 200 | }, 201 | 'same minute2(new Date())': { 202 | run: function() { }, 203 | assert: function() { 204 | return !Date.today().same().minute(new Date()); 205 | } 206 | }, 207 | 'same second2(new Date())': { 208 | run: function() { }, 209 | assert: function() { 210 | return !Date.today().same().second(new Date()); 211 | } 212 | }, 213 | 'same millisecond2(new Date())': { 214 | run: function() { }, 215 | assert: function() { 216 | return !Date.today().same().millisecond(new Date()); 217 | } 218 | } 219 | 220 | } 221 | }); 222 | 223 | -------------------------------------------------------------------------------- /test/sugarpak/jasmine.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : Core Library 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /test/time/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : Times 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 |

Times

34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /test/tostring/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Datejs Test Cases : .toString 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 |

.toString

35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /test/tostring/index.js: -------------------------------------------------------------------------------- 1 | if(typeof require !== 'undefined') { 2 | var Specification = require('../scripts/specification-converter.js'); 3 | } 4 | 5 | Date.Specification = new Specification({ 6 | 'en-US': { 7 | setup: function() { 8 | this.today = new Date().clearTime(); 9 | }, 10 | '"12:00 AM" : "hh:mm tt"': { 11 | run: function() {}, 12 | assert: function() { 13 | return Date.today().toString("hh:mm tt") == "12:00 AM"; 14 | } 15 | }, 16 | '"12:05 AM" : "hh:mm tt"': { 17 | run: function() {}, 18 | assert: function() { 19 | return Date.today().set({minute: 5}).toString("hh:mm tt") == "12:05 AM"; 20 | } 21 | }, 22 | '"12:00 PM" : "hh:mm tt"': { 23 | run: function() {}, 24 | assert: function() { 25 | return Date.today().set({hour: 12}).toString("hh:mm tt") == "12:00 PM"; 26 | } 27 | }, 28 | '"12:05 PM" : "hh:mm tt"': { 29 | run: function() {}, 30 | assert: function() { 31 | return Date.today().set({hour: 12, minute: 5}).toString("hh:mm tt") == "12:05 PM"; 32 | } 33 | }, 34 | '"December 16, 2007 - 12:00 PM" : "MMMM dd, yyyy - hh:mm tt"': { 35 | run: function() {}, 36 | assert: function() { 37 | return new Date(2007,11,16,12,0,0).toString("MMMM dd, yyyy - hh:mm tt") == "December 16, 2007 - 12:00 PM"; 38 | } 39 | }, 40 | '"December 16, 2007 - 12:00 AM" : "MMMM dd, yyyy - hh:mm tt"': { 41 | run: function() {}, 42 | assert: function() { 43 | return new Date(2007,11,16,0,0,0).toString("MMMM dd, yyyy - hh:mm tt") == "December 16, 2007 - 12:00 AM"; 44 | } 45 | }, 46 | '"December 16, 2007 - 12:51 AM" : "MMMM dd, yyyy - hh:mm tt"': { 47 | run: function() {}, 48 | assert: function() { 49 | return new Date(2007,11,16,0,51,53).toString("MMMM dd, yyyy - hh:mm tt") == "December 16, 2007 - 12:51 AM"; 50 | } 51 | } 52 | }, 53 | 54 | 'Ordinal suffix, .toString("S")': { 55 | setup: function() {}, 56 | '1st': { 57 | run: function() { }, 58 | assert: function() { return (new Date(2008, 0, 1).toString("S") == "st"); } 59 | }, 60 | '2nd': { 61 | run: function() { }, 62 | assert: function() { return (new Date(2008, 0, 2).toString("S") == "nd"); } 63 | }, 64 | '3rd': { 65 | run: function() { }, 66 | assert: function() { return (new Date(2008, 0, 3).toString("S") == "rd"); } 67 | }, 68 | '4th': { 69 | run: function() { }, 70 | assert: function() { return (new Date(2008, 0, 4).toString("S") == "th"); } 71 | }, 72 | '5th': { 73 | run: function() { }, 74 | assert: function() { return (new Date(2008, 0, 5).toString("S") == "th"); } 75 | }, 76 | '6th': { 77 | run: function() { }, 78 | assert: function() { return (new Date(2008, 0, 6).toString("S") == "th"); } 79 | }, 80 | '7th': { 81 | run: function() { }, 82 | assert: function() { return (new Date(2008, 0, 7).toString("S") == "th"); } 83 | }, 84 | '8th': { 85 | run: function() { }, 86 | assert: function() { return (new Date(2008, 0, 8).toString("S") == "th"); } 87 | }, 88 | '9th': { 89 | run: function() { }, 90 | assert: function() { return (new Date(2008, 0, 9).toString("S") == "th"); } 91 | }, 92 | '10th': { 93 | run: function() { }, 94 | assert: function() { return (new Date(2008, 0, 10).toString("S") == "th"); } 95 | }, 96 | '11th': { 97 | run: function() { }, 98 | assert: function() { return (new Date(2008, 0, 11).toString("S") == "th"); } 99 | }, 100 | '12th': { 101 | run: function() { }, 102 | assert: function() { return (new Date(2008, 0, 12).toString("S") == "th"); } 103 | }, 104 | '13th': { 105 | run: function() { }, 106 | assert: function() { return (new Date(2008, 0, 13).toString("S") == "th"); } 107 | }, 108 | '14th': { 109 | run: function() { }, 110 | assert: function() { return (new Date(2008, 0, 14).toString("S") == "th"); } 111 | }, 112 | '15th': { 113 | run: function() { }, 114 | assert: function() { return (new Date(2008, 0, 15).toString("S") == "th"); } 115 | }, 116 | '16th': { 117 | run: function() { }, 118 | assert: function() { return (new Date(2008, 0, 16).toString("S") == "th"); } 119 | }, 120 | '17th': { 121 | run: function() { }, 122 | assert: function() { return (new Date(2008, 0, 17).toString("S") == "th"); } 123 | }, 124 | '18th': { 125 | run: function() { }, 126 | assert: function() { return (new Date(2008, 0, 18).toString("S") == "th"); } 127 | }, 128 | '19th': { 129 | run: function() { }, 130 | assert: function() { return (new Date(2008, 0, 19).toString("S") == "th"); } 131 | }, 132 | '20th': { 133 | run: function() { }, 134 | assert: function() { return (new Date(2008, 0, 20).toString("S") == "th"); } 135 | }, 136 | '21th': { 137 | run: function() { }, 138 | assert: function() { return (new Date(2008, 0, 21).toString("S") == "st"); } 139 | }, 140 | '22th': { 141 | run: function() { }, 142 | assert: function() { return (new Date(2008, 0, 22).toString("S") == "nd"); } 143 | }, 144 | '23rd': { 145 | run: function() { }, 146 | assert: function() { return (new Date(2008, 0, 23).toString("S") == "rd"); } 147 | }, 148 | '24th': { 149 | run: function() { }, 150 | assert: function() { return (new Date(2008, 0, 24).toString("S") == "th"); } 151 | }, 152 | '25th': { 153 | run: function() { }, 154 | assert: function() { return (new Date(2008, 0, 25).toString("S") == "th"); } 155 | }, 156 | '26th': { 157 | run: function() { }, 158 | assert: function() { return (new Date(2008, 0, 26).toString("S") == "th"); } 159 | }, 160 | '27th': { 161 | run: function() { }, 162 | assert: function() { return (new Date(2008, 0, 27).toString("S") == "th"); } 163 | }, 164 | '28th': { 165 | run: function() { }, 166 | assert: function() { return (new Date(2008, 0, 28).toString("S") == "th"); } 167 | }, 168 | '29th': { 169 | run: function() { }, 170 | assert: function() { return (new Date(2008, 0, 29).toString("S") == "th"); } 171 | }, 172 | '30th': { 173 | run: function() { }, 174 | assert: function() { return (new Date(2008, 0, 30).toString("S") == "th"); } 175 | }, 176 | '31th': { 177 | run: function() { }, 178 | assert: function() { return (new Date(2008, 0, 31).toString("S") == "st"); } 179 | } 180 | } 181 | 182 | }); 183 | --------------------------------------------------------------------------------