]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Moving format YY and format z/zz to global unit tests #55
authorTim Wood <washwithcare@gmail.com>
Mon, 14 Nov 2011 17:57:11 +0000 (09:57 -0800)
committerTim Wood <washwithcare@gmail.com>
Mon, 14 Nov 2011 17:57:11 +0000 (09:57 -0800)
Also expanding timezone format unit test to accept 3-5 uppercase
characters.

15 files changed:
lang/test/de.js
lang/test/en.js
lang/test/es.js
lang/test/fr.js
lang/test/it.js
lang/test/nl.js
lang/test/pl.js
lang/test/pt.js
lang/test/sv.js
site/docs/index.html
site/index.html
site/js/test.min.js
site/test/index.html
sitesrc/js/lang-tests.js
sitesrc/js/unit-tests.js

index 9b8aeffc5dff97b2c0ddcff69c41bdd71c098b90..f8e7a800663034009b863dd22543684b66c7eaee 100644 (file)
@@ -34,17 +34,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('de');
     equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
index ff5350183e4efebc242e5f01e4e8a6ff7232169a..7e8fca27cb743549dc4fe8ee3865a796890b1d26 100644 (file)
@@ -34,17 +34,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('en');
     equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
index 2cea3ad3e96c1a47064e561c30060fc81de64f6f..9c354a67117a8abf620f6d7948714e0dae1e14d6 100644 (file)
@@ -34,17 +34,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('es');
     equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
index 1db073d11eb26c117d3b23f65ade5c150f562f85..d352ebdc4c9536e29745250fca13ebabfd5af2f9 100644 (file)
@@ -34,17 +34,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('fr');
     equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er');
index f325fcc24081ec3233340485b024d295776e0768..0e2b843de160795211170f62211f0871a8dd0eb0 100644 (file)
@@ -34,17 +34,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('it');
     equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
index db2970cf8dcf796267da41af5248fd37729b6f10..b737580dfccb211e0de1f6ed7482a4e407f7af3b 100644 (file)
@@ -34,17 +34,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('nl');
     equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste');
index 35beec3549dd85ee225837b3e848982541822c7b..c257da657282262f197c063262138182a351899f 100644 (file)
@@ -34,17 +34,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('pl');
     equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
index eaf68eb58abbd30a095cd233e1f7274f8173d426..685c600799a82595721ef0b5744b92555a58900f 100644 (file)
@@ -34,17 +34,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('pt');
     equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
index c2771ac4899877b5ce8f8d78f0f932fe2030ffd5..b7cd620dd7fc127ebf917a423638347278ff0860 100644 (file)
@@ -34,17 +34,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('sv');
     equal(moment([2011, 0, 1]).format('DDDo'), '1a', '1a');
index dde8117017c58e94e2a5bf6277c6c8c91bb8db0e..b98a140d6ce6b5ffd0a2faa85e4e8aba05bd7d83 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"><link rel="stylesheet" href="../css/style.css?_=111114_094639"><title>Moment.js Documentation</title></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/" class="btn clean-gray">Home</a></li><li><a href="/docs/" class="btn clean-gray">Documentation</a></li><li><a href="/test/" class="btn clean-gray">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment" class="btn clean-gray">Github</a></li></ul></div></div><div id="content"><div id="docnav"><h2><a href="#/get-it"><span>Get it</span></a></h2><ul><li><a href="#/get-it/github">Github</a></li><li><a href="#/get-it/npm">npm</a></li></ul><h2><a href="#/use-it"><span>Use it</span></a></h2><ul><li><a href="#/use-it/node">In NodeJS</a></li><li><a href="#/use-it/browser">In the browser</a></li></ul><h2><a href="#/parsing"><span>Parsing</span></a></h2><ul><li><a href="#/parsing/date">Javascript Date Object</a></li><li><a href="#/parsing/unix">Unix Timestamp</a></li><li><a href="#/parsing/string">String</a></li><li><a href="#/parsing/string+format">String + Format</a></li><li><a href="#/parsing/string+formats">String + Formats</a></li><li><a href="#/parsing/now">Now</a></li><li><a href="#/parsing/array">Javascript Array</a></li></ul><h2><a href="#/manipulation"><span>Manipulation</span></a></h2><ul><li><a href="#/manipulation/add">Add</a></li><li><a href="#/manipulation/subtract">Subtract</a></li><li><a href="#/manipulation/seconds">Seconds</a></li><li><a href="#/manipulation/minutes">Minutes</a></li><li><a href="#/manipulation/hours">Hours</a></li><li><a href="#/manipulation/date">Date</a></li><li><a href="#/manipulation/month">Month</a></li><li><a href="#/manipulation/year">Year</a></li></ul><h2><a href="#/display"><span>Display</span></a></h2><ul><li><a href="#/display/format">Formatted date</a></li><li><a href="#/display/from">Time from another moment</a></li><li><a href="#/display/fromNow">Time from now</a></li><li><a href="#/display/diff">Difference</a></li><li><a href="#/display/native">Native Date</a></li><li><a href="#/display/valueOf">Value</a></li><li><a href="#/display/seconds">Seconds</a></li><li><a href="#/display/minutes">Minutes</a></li><li><a href="#/display/hours">Hours</a></li><li><a href="#/display/date">Date</a></li><li><a href="#/display/day">Day</a></li><li><a href="#/display/month">Month</a></li><li><a href="#/display/year">Year</a></li><li><a href="#/display/leapyear">Leap Year</a></li></ul><h2><a href="#/i18n"><span>I18N</span></a></h2><ul><li><a href="#/i18n/lang">Changing languages</a></li><li><a href="#/i18n/node">Loading languages in NodeJS</a></li><li><a href="#/i18n/browser">Loading languages in the browser</a></li><li><a href="#/i18n/add">Adding your language to Moment.js</a></li></ul><h2><a href="#/custom"><span>I18N</span></a></h2><ul><li><a href="#/custom/months">Month Names</a></li><li><a href="#/custom/monthsShort">Month Abbreviations</a></li><li><a href="#/custom/weekdays">Weekday Names</a></li><li><a href="#/custom/weekdaysShort">Weekday Abbreviations</a></li><li><a href="#/custom/longDateFormats">Long Date Formats</a></li><li><a href="#/custom/relativeTime">Relative Time</a></li><li><a href="#/custom/ordinal">Ordinal</a></li></ul></div><div id="docs"><h1>Moment.js Documentation</h1><p>A lightweight javascript date library for parsing, manipulating, and formatting dates.</p><a name="/get-it"></a><h2><span>Where to get it</span></h2><a name="/get-it/github"></a><h3><span>Github</span></h3><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.min.js" class="btn cupid-green"><strong>Production </strong><span class="version">Version 1.1.1</span><span class="filesize">2.5kb minified &amp; gzipped</span></a><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.js" class="btn minimal"><strong>Development </strong><span class="version">Version 1.1.1</span><span class="filesize">17.9kb full source + comments</span></a><p>You can also clone the project with Git by running:</p><pre>git clone git://github.com/timrwood/moment</pre><a name="/get-it/npm"></a><h3><span>npm</span></h3><pre>npm install moment</pre><a name="/use-it"></a><h2><span>Where to use it</span></h2><p>Moment was designed to work in both the browser and in NodeJS. All code will work in both environments. All unit tests are run in both environments.</p><a name="/use-it/node"></a><h3><span>In NodeJS</span></h3><pre>var moment = require('moment');
+<!DOCTYPE html><html><head><meta charset="utf-8"><link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"><link rel="stylesheet" href="../css/style.css?_=111114_095536"><title>Moment.js Documentation</title></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/" class="btn clean-gray">Home</a></li><li><a href="/docs/" class="btn clean-gray">Documentation</a></li><li><a href="/test/" class="btn clean-gray">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment" class="btn clean-gray">Github</a></li></ul></div></div><div id="content"><div id="docnav"><h2><a href="#/get-it"><span>Get it</span></a></h2><ul><li><a href="#/get-it/github">Github</a></li><li><a href="#/get-it/npm">npm</a></li></ul><h2><a href="#/use-it"><span>Use it</span></a></h2><ul><li><a href="#/use-it/node">In NodeJS</a></li><li><a href="#/use-it/browser">In the browser</a></li></ul><h2><a href="#/parsing"><span>Parsing</span></a></h2><ul><li><a href="#/parsing/date">Javascript Date Object</a></li><li><a href="#/parsing/unix">Unix Timestamp</a></li><li><a href="#/parsing/string">String</a></li><li><a href="#/parsing/string+format">String + Format</a></li><li><a href="#/parsing/string+formats">String + Formats</a></li><li><a href="#/parsing/now">Now</a></li><li><a href="#/parsing/array">Javascript Array</a></li></ul><h2><a href="#/manipulation"><span>Manipulation</span></a></h2><ul><li><a href="#/manipulation/add">Add</a></li><li><a href="#/manipulation/subtract">Subtract</a></li><li><a href="#/manipulation/seconds">Seconds</a></li><li><a href="#/manipulation/minutes">Minutes</a></li><li><a href="#/manipulation/hours">Hours</a></li><li><a href="#/manipulation/date">Date</a></li><li><a href="#/manipulation/month">Month</a></li><li><a href="#/manipulation/year">Year</a></li></ul><h2><a href="#/display"><span>Display</span></a></h2><ul><li><a href="#/display/format">Formatted date</a></li><li><a href="#/display/from">Time from another moment</a></li><li><a href="#/display/fromNow">Time from now</a></li><li><a href="#/display/diff">Difference</a></li><li><a href="#/display/native">Native Date</a></li><li><a href="#/display/valueOf">Value</a></li><li><a href="#/display/seconds">Seconds</a></li><li><a href="#/display/minutes">Minutes</a></li><li><a href="#/display/hours">Hours</a></li><li><a href="#/display/date">Date</a></li><li><a href="#/display/day">Day</a></li><li><a href="#/display/month">Month</a></li><li><a href="#/display/year">Year</a></li><li><a href="#/display/leapyear">Leap Year</a></li></ul><h2><a href="#/i18n"><span>I18N</span></a></h2><ul><li><a href="#/i18n/lang">Changing languages</a></li><li><a href="#/i18n/node">Loading languages in NodeJS</a></li><li><a href="#/i18n/browser">Loading languages in the browser</a></li><li><a href="#/i18n/add">Adding your language to Moment.js</a></li></ul><h2><a href="#/custom"><span>I18N</span></a></h2><ul><li><a href="#/custom/months">Month Names</a></li><li><a href="#/custom/monthsShort">Month Abbreviations</a></li><li><a href="#/custom/weekdays">Weekday Names</a></li><li><a href="#/custom/weekdaysShort">Weekday Abbreviations</a></li><li><a href="#/custom/longDateFormats">Long Date Formats</a></li><li><a href="#/custom/relativeTime">Relative Time</a></li><li><a href="#/custom/ordinal">Ordinal</a></li></ul></div><div id="docs"><h1>Moment.js Documentation</h1><p>A lightweight javascript date library for parsing, manipulating, and formatting dates.</p><a name="/get-it"></a><h2><span>Where to get it</span></h2><a name="/get-it/github"></a><h3><span>Github</span></h3><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.min.js" class="btn cupid-green"><strong>Production </strong><span class="version">Version 1.1.1</span><span class="filesize">2.5kb minified &amp; gzipped</span></a><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.js" class="btn minimal"><strong>Development </strong><span class="version">Version 1.1.1</span><span class="filesize">17.9kb full source + comments</span></a><p>You can also clone the project with Git by running:</p><pre>git clone git://github.com/timrwood/moment</pre><a name="/get-it/npm"></a><h3><span>npm</span></h3><pre>npm install moment</pre><a name="/use-it"></a><h2><span>Where to use it</span></h2><p>Moment was designed to work in both the browser and in NodeJS. All code will work in both environments. All unit tests are run in both environments.</p><a name="/use-it/node"></a><h3><span>In NodeJS</span></h3><pre>var moment = require('moment');
 moment().add('hours', 1).fromNow(); // &quot;1 hour ago&quot;
 </pre><a name="/use-it/browser"></a><h3><span>In the browser</span></h3><pre>&lt;script src="moment.min.js">&lt;/script>
 moment().add('hours', 1).fromNow(); // &quot;1 hour ago&quot;
@@ -190,7 +190,7 @@ moment(1316116057189).fromNow(); // il y a une heure
         (b === 2) ? 'nd' : 
         (b === 3) ? 'rd' : 'th';
 };
-</pre><p>For more information on ordinal numbers, see <a href="http://en.wikipedia.org/wiki/Ordinal_number_%28linguistics%29">wikipedia</a></p><div class="footer"></div></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="../js/docs.min.js?_=111114_094639"></script><script>window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
+</pre><p>For more information on ordinal numbers, see <a href="http://en.wikipedia.org/wiki/Ordinal_number_%28linguistics%29">wikipedia</a></p><div class="footer"></div></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="../js/docs.min.js?_=111114_095536"></script><script>window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
 (function(d, c) {
   var ga = d.createElement(c); ga.async = true;
   ga.src = "http://www.google-analytics.com/ga.js";
index 16e7d9e38270baca3feff47ac779cb07577a5f65..38650e99dd24a5e96c2f7832c4cfc51ff6ad8358 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"><link rel="stylesheet" href="css/style.css?_=111114_094639"><title>Moment.js - A lightweight javascript date library</title></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/" class="btn clean-gray">Home</a></li><li><a href="/docs/" class="btn clean-gray">Documentation</a></li><li><a href="/test/" class="btn clean-gray">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment" class="btn clean-gray">Github</a></li></ul></div></div><div id="content"><div id="home"><h2>Moment.js</h2><h3>A lightweight javascript date library for parsing, manipulating, and formatting dates.</h3><div class="col1"><h4><span>Get it</span></h4><pre>npm install moment</pre><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.min.js" class="btn cupid-green"><strong>Production </strong><span class="version">Version 1.1.1</span><span class="filesize">2.5kb minified &amp; gzipped</span></a><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.js" class="btn minimal"><strong>Development </strong><span class="version">Version 1.1.1</span><span class="filesize">17.9kb full source + comments</span></a></div><div class="col2"><h4><span>Use it</span></h4><pre class="js">var now = moment();
+<!DOCTYPE html><html><head><meta charset="utf-8"><link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"><link rel="stylesheet" href="css/style.css?_=111114_095536"><title>Moment.js - A lightweight javascript date library</title></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/" class="btn clean-gray">Home</a></li><li><a href="/docs/" class="btn clean-gray">Documentation</a></li><li><a href="/test/" class="btn clean-gray">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment" class="btn clean-gray">Github</a></li></ul></div></div><div id="content"><div id="home"><h2>Moment.js</h2><h3>A lightweight javascript date library for parsing, manipulating, and formatting dates.</h3><div class="col1"><h4><span>Get it</span></h4><pre>npm install moment</pre><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.min.js" class="btn cupid-green"><strong>Production </strong><span class="version">Version 1.1.1</span><span class="filesize">2.5kb minified &amp; gzipped</span></a><a href="https://raw.github.com/timrwood/moment/1.1.1/moment.js" class="btn minimal"><strong>Development </strong><span class="version">Version 1.1.1</span><span class="filesize">17.9kb full source + comments</span></a></div><div class="col2"><h4><span>Use it</span></h4><pre class="js">var now = moment();
 console.log(now.format('dddd, MMMM Do YYYY, h:mm:ss a'));
 </pre><h5><span id="js-format-now"></span></h5><pre class="js">var halloween = moment([2011, 9, 31]); \\ October 31st
 console.log(halloween.fromNow());
@@ -7,7 +7,7 @@ console.log(now.format('dddd, MMMM Do YYYY'));
 </pre><h5><span id="js-add"></span></h5><pre class="js">var now = moment();
 moment.lang('fr')
 console.log(now.format('LLLL'));
-</pre><h5><span id="js-lang"></span></h5></div></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="js/home.min.js?_=111114_094639"></script><script>window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
+</pre><h5><span id="js-lang"></span></h5></div></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="js/home.min.js?_=111114_095536"></script><script>window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
 (function(d, c) {
   var ga = d.createElement(c); ga.async = true;
   ga.src = "http://www.google-analytics.com/ga.js";
index b18c5c812dd2daae02cf9c6df0dde029c7ecda91..ffee54c5a96774677bb2b1d55d465c0ef597d56a 100644 (file)
@@ -1708,6 +1708,21 @@ test("chaining setters", 7, function() {
     equal(a.seconds(), 8, 'second');
 });
 
+
+module("format");
+
+
+test("format YY", 1, function() {
+    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
+    equal(b.format('YY'), '09', 'YY ---> 09');
+});
+
+test("format timezone", 2, function() {
+    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
+    ok(b.format('z').match(/^[A-Z]{3,5}$/), b.format('z') + ' ---> Something like "PST"');
+    ok(b.format('zz').match(/^[A-Z]{3,5}$/), b.format('zz') + ' ---> Something like "PST"');
+});
+
 })();
 
 (function() { var moment; if (typeof window === 'undefined') { moment = require('../../moment'); module = QUnit.module; } else { moment = window.moment; }
@@ -1746,17 +1761,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('en');
     equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
@@ -1903,17 +1907,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('fr');
     equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er');
@@ -2052,17 +2045,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('it');
     equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
@@ -2201,17 +2183,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('pt');
     equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
@@ -2350,17 +2321,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('es');
     equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
@@ -2507,17 +2467,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('nl');
     equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste');
@@ -2664,17 +2613,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('de');
     equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
@@ -2813,17 +2751,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('sv');
     equal(moment([2011, 0, 1]).format('DDDo'), '1a', '1a');
@@ -2970,17 +2897,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('pl');
     equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
index a1f6f77a3ec56ac37000e15c8c232a9325820f83..1fa18ce92fcea14ef5cd8f78ae81d93e60811f3a 100755 (executable)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"><link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"><link rel="stylesheet" href="../css/style.css?_=111114_094639"><title>Moment.js Unit Test Suite</title></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/" class="btn clean-gray">Home</a></li><li><a href="/docs/" class="btn clean-gray">Documentation</a></li><li><a href="/test/" class="btn clean-gray">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment" class="btn clean-gray">Github</a></li></ul></div></div><div id="content"><div id="test"><h1>Moment.js unit test suite</h1><h2 id="qunit-banner"></h2><h4 id="qunit-userAgent"></h4><ol id="qunit-tests"></ol></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="../js/moment.min.js?_=111114_094639"></script><script src="../js/lang-all.min.js?_=111114_094639"></script><script src="../js/test.min.js?_=111114_094639"></script><script>window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
+<!DOCTYPE html><html><head><meta charset="utf-8"><link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet"><link rel="stylesheet" href="../css/style.css?_=111114_095536"><title>Moment.js Unit Test Suite</title></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/" class="btn clean-gray">Home</a></li><li><a href="/docs/" class="btn clean-gray">Documentation</a></li><li><a href="/test/" class="btn clean-gray">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment" class="btn clean-gray">Github</a></li></ul></div></div><div id="content"><div id="test"><h1>Moment.js unit test suite</h1><h2 id="qunit-banner"></h2><h4 id="qunit-userAgent"></h4><ol id="qunit-tests"></ol></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="../js/moment.min.js?_=111114_095536"></script><script src="../js/lang-all.min.js?_=111114_095536"></script><script src="../js/test.min.js?_=111114_095536"></script><script>window._gaq = [['_setAccount','UA-10641787-5'],['_trackPageview'],['_trackPageLoadTime']];
 (function(d, c) {
   var ga = d.createElement(c); ga.async = true;
   ga.src = "http://www.google-analytics.com/ga.js";
index 22970ac83e52d23ed954a8f880ce32bd11f301d6..a69c41f5c4594c2ea03f7600b57dbe16cb2e0b9e 100644 (file)
@@ -34,17 +34,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('en');
     equal(moment([2011, 0, 1]).format('DDDo'), '1st', '1st');
@@ -191,17 +180,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('fr');
     equal(moment([2011, 0, 1]).format('DDDo'), '1er', '1er');
@@ -340,17 +318,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('it');
     equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
@@ -489,17 +456,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('pt');
     equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
@@ -638,17 +594,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('es');
     equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º');
@@ -795,17 +740,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('nl');
     equal(moment([2011, 0, 1]).format('DDDo'), '1ste', '1ste');
@@ -952,17 +886,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('de');
     equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
@@ -1101,17 +1024,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('sv');
     equal(moment([2011, 0, 1]).format('DDDo'), '1a', '1a');
@@ -1258,17 +1170,6 @@ test("format", 18, function() {
     }
 });
 
-test("format YY", 1, function() {
-    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
-    equal(b.format('YY'), '09', 'YY ---> 09');
-});
-
-test("format timezone", 2, function() {
-    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
-    ok(b.format('z').match(/^[A-Z]{3,4}$/), 'z ---> Something like "PST"');
-    ok(b.format('zz').match(/^[A-Z]{3,4}$/), 'zz ---> Something like "PST"');
-});
-
 test("format ordinal", 31, function() {
     moment.lang('pl');
     equal(moment([2011, 0, 1]).format('DDDo'), '1.', '1.');
index 0b69f98cb666ed0bdfdc3080aad822ed904590d6..6256c3afcbcbdee9ee2366f945bb059364238c6e 100755 (executable)
@@ -292,5 +292,20 @@ test("chaining setters", 7, function() {
     equal(a.seconds(), 8, 'second');
 });
 
+
+module("format");
+
+
+test("format YY", 1, function() {
+    var b = moment(new Date(2009, 1, 14, 15, 25, 50, 125));
+    equal(b.format('YY'), '09', 'YY ---> 09');
+});
+
+test("format timezone", 2, function() {
+    var b = moment(new Date(2010, 1, 14, 15, 25, 50, 125));
+    ok(b.format('z').match(/^[A-Z]{3,5}$/), b.format('z') + ' ---> Something like "PST"');
+    ok(b.format('zz').match(/^[A-Z]{3,5}$/), b.format('zz') + ' ---> Something like "PST"');
+});
+
 })();