\r
pre, code { font-size:14px; line-height:1.5em; font-family:Consolas, "Courier New", Courier, monospace; }\r
\r
-pre { background:rgba(0, 0, 0, .05); display:block; padding:10px 20px; margin-bottom:20px; white-space:pre; white-space:pre-wrap; word-wrap:break-word; }\r
+pre { background:#ddd; display:block; border:1px solid #ccc; padding:5px 10px; margin-bottom:20px; white-space:pre; white-space:pre-wrap; word-wrap:break-word; border-radius:2px; }\r
\r
-p code { background:rgba(0, 0, 0, .05); padding:0 5px; }\r
+p code { background:#ddd; padding:3px; border-radius:2px; }\r
\r
table { margin-bottom:20px; width:100%; } \r
\r
\r
b, strong { font-weight:bold; }\r
\r
-/*\r
- * special\r
- */\r
\r
-.logo { text-align:center; border-bottom:#313749 10px solid; margin:0 -41px; }\r
-.fork-me { position:absolute; top:0; right:0; text-indent:-9999px; width:149px; height:149px; display:block; background:url(fork.png); }\r
+/****************\r
+ Special\r
+****************/\r
+\r
+\r
+.footer { height:100px; }\r
+\r
\r
/****************\r
Nav\r
#nav { height:60px; width:960px; margin:0 auto; text-align:left; }\r
#navwrap ul { padding:10px 0; height:40px; }\r
#navwrap li { line-height:40px; height:40px; margin-right:10px; float:left; list-style:none; }\r
-#navwrap li a { display:block; color:#fff; font-size:20px; font-family:Oswald, sans-serif; padding:0 10px; background:#333; border-radius:3px; text-decoration:none; }\r
+#navwrap li a { display:block; color:#fff; font-size:18px; font-family:Oswald, sans-serif; padding:0 10px; background:#333; border-radius:3px; text-decoration:none; }\r
\r
\r
/****************\r
\r
\r
#docs { padding:0 100px 0 40px; position:fixed; top:60px; bottom:0; right:10px; left:242px; overflow-x:hidden; overflow-y:scroll; text-align:left; background:url(../img/gradient.gif) 0 0 repeat-y; }\r
-#docs h3 { height:14px; border-bottom:6px solid #ddd; margin:0 0 20px; padding:0 20px; }\r
+#docs h2 { height:20px; border-bottom:6px solid #bbb; margin:0 0 40px; padding:20px 20px 0; }\r
+#docs h2 span { background:#eee; padding:0 10px; line-height:36px; font-size:36px; }\r
+#docs h3 { height:14px; border-bottom:6px solid #e6e6e6; margin:0 0 40px; padding:20px 20px 0; }\r
#docs h3 span { background:#eee; padding:0 10px; line-height:24px; font-size:24px; }\r
\r
/**********************\r
-<!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"></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/">Home</a></li><li><a href="/docs/">Documentation</a></li><li><a href="/examples/">Examples</a></li><li><a href="/test/">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment">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="#/get-it"><span>Get 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/day">Day</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/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</h1><p>A lightweight javascript date library for parsing, manipulating, and formatting dates.</p><p>It doesn't modify the native <code>Date.prototype</code>so it's safe to drop into any project.
-</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/master/moment.min.js" class="btn cupid-green"><strong>Production </strong><span class="version">Version 1.1.0</span><span class="filesize">2.5kb minified & gzipped</span></a><a href="https://raw.github.com/timrwood/moment/master/moment.js" class="btn minimal"><strong>Development </strong><span class="version">Version 1.1.0</span><span class="filesize">17.7kb 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"></head><body><div id="navwrap"><div id="nav"><h1>Moment.js</h1><ul><li><a href="/">Home</a></li><li><a href="/docs/">Documentation</a></li><li><a href="/examples/">Examples</a></li><li><a href="/test/">Unit Tests</a></li><li><a href="https://github.com/timrwood/moment">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/day">Day</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/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/master/moment.min.js" class="btn cupid-green"><strong>Production </strong><span class="version">Version 1.1.0</span><span class="filesize">2.5kb minified & gzipped</span></a><a href="https://raw.github.com/timrwood/moment/master/moment.js" class="btn minimal"><strong>Development </strong><span class="version">Version 1.1.0</span><span class="filesize">17.7kb 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(); // "1 hour ago"
-</pre><a name="/use-it/browser"></a><h3><span>In the browser</span></h3><pre><script src="moment.min.js"></script>
+</pre><a name="/use-it/browser"></a><h3><span>In the browser</span></h3><pre><script src="moment.min.js"></script>
moment().add('hours', 1).fromNow(); // "1 hour ago"
</pre><a name="/parsing"></a><h2><span>Parsing</span></h2><p>Instead of modifying the native <code>Date.prototype</code>, Moment.js creates a wrapper for the
<code>Date</code>object.
</p><p>To get this wrapper object, simply call <code>moment()</code>with one of the supported input types.
</p><a name="/parsing/date"></a><h3><span>Javascript Date Object</span></h3><p>A native Javascript Date object.</p><pre>var day = new Date(2011, 9, 16);
var dayWrapper = moment(day);
-
-
-
-var otherDay = moment(new Date(2020, 3, 7));
-</pre><p>This is the fastest way to get a Moment.js wrapper.</p><a name="/parsing/unix"></a><h3><span>Unix Timestamp</span></h3><p>An integer value representing the number of milliseconds since 1 January 1970 00:00:00 UTC.</p><pre>var day = moment(1318781876406);</pre><a name="/parsing/string"></a><h3><span>String</span></h3><p>A string that can be parsed by <code>Date.parse</code>.
+</pre><pre>var otherDay = moment(new Date(2020, 3, 7));</pre><p>This is the fastest way to get a Moment.js wrapper.</p><a name="/parsing/unix"></a><h3><span>Unix Timestamp</span></h3><p>An integer value representing the number of milliseconds since 1 January 1970 00:00:00 UTC.</p><pre>var day = moment(1318781876406);</pre><a name="/parsing/string"></a><h3><span>String</span></h3><p>A string that can be parsed by <code>Date.parse</code>.
</p><pre>var day = moment("Dec 25, 1995");</pre><p>Browser support for this is somewhat inconsistent. If you are not getting consistent results, you can try using String + Format.</p><a name="/parsing/string+format"></a><h3><span>String + Format</span></h3><p>An input string and a format string</p><pre>var day = moment("12-25-1995", "MM-DD-YYYY");</pre><p>The format parsing tokens are similar to the tokens for <code>moment.fn.format</code>.
</p><p>The parser ignores non-alphanumeric characters, so both <code>moment("12-25-1995", "MM-DD-YYYY")</code>and
<code>moment("12\15\ 1995", "MM-DD-YYYY")</code>will return the same thing.
</p><a name="/parsing/string+formats"></a><h3><span>String + Formats</span></h3><p>An input string and an array of format strings.</p><p>This is the same as String + Format, only it will try to match the input to multiple formats.</p><pre>var day = moment("12-25-1995", ["MM-DD-YYYY", "YYYY-MM-DD"]);</pre><p>This approach is fundamentally problematic in cases like the following.</p><pre>var day = moment("05-06-1995", ["MM-DD-YYYY", "DD-MM-YYYY"]); // June 5th or May 6th?</pre><p><strong>Important:</strong>THIS IS SLOW. This should only be used as a last line of defense.
</p><a name="/parsing/now"></a><h3><span>Now</span></h3><p>To get the current time, just call <code>moment()</code>with no parameters.
</p><pre>var now = moment();</pre><p>This is essentially the same as calling <code>moment(new Date())</code>.
-</p><a name="/parsing/array"></a><h3><span>Javascript Array</span></h3><p>An array mirroring the parameters passed into <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/UTC">Date.UTC()</a></p><pre></pre><!-- [year, month = 0, date = 1, hours = 0, minutes = 0, seconds = 0, milliseconds = 0]
-var day = moment([2010, 1, 14, 15, 25, 50, 125]); // February 14th, 3:25:50.125 PM
---><p>Any value past the year is optional, and will default to the lowest possible number.</p><pre>var day = moment([2010]); // January 1st
+</p><a name="/parsing/array"></a><h3><span>Javascript Array</span></h3><p>An array mirroring the parameters passed into <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/UTC">Date.UTC()</a></p><pre>[year, month = 0, date = 1, hours = 0, minutes = 0, seconds = 0, milliseconds = 0] var day = moment([2010, 1, 14, 15, 25, 50, 125]); // February 14th, 3:25:50.125 PM
+</pre><p>Any value past the year is optional, and will default to the lowest possible number.</p><pre>var day = moment([2010]); // January 1st
var day = moment([2010, 6]); // July 1st
-
var day = moment([2010, 6, 10]); // July 10th
-</pre><a name="/manipulation"></a></div></div><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script src="js/home.min.js"></script></body></html>
\ No newline at end of file
+</pre><a name="/manipulation"></a><h2><span>Manipulation</span></h2><p>Once you have a Moment.js wrapper object, you may want to manipulate it in some way. There are a number of <code>moment.fn</code>methods to help with this.
+</p><p>All manipulation methods are chainable, so you can do crazy things like this.</p><pre>moment().add('days', 7).subtract('months', 1).year(2009).hours(0).minutes(0).seconds(0);</pre><a name="/manipulation/add"></a><h3><span>Adding Time</span></h3><p>This is a pretty robust function for adding time to an existing date. To add time, pass the key of what time you want to add, and the amount you want to add.
+</p><pre>moment().add('days', 7);</pre><p>There are some shorthand keys as well if you're into that whole brevity thing.</p><pre>moment().add('d', 7);</pre><table><tbody><tr><th>Key</th><th>Shorthand</th></tr><tr><td>years</td><td>y</td></tr><tr><td>months</td><td>M</td></tr><tr><td>weeks</td><td>w</td></tr><tr><td>days</td><td>d</td></tr><tr><td>hours</td><td>h</td></tr><tr><td>minutes</td><td>m</td></tr><tr><td>seconds</td><td>s</td></tr><tr><td>milliseconds</td><td>ms</td></tr></tbody></table><p>If you want to add multiple different keys at the same time, you can pass them in as an object literal.</p><pre>moment().add('days', 7).add('months', 1); // with chaining
+moment().add({days:7,months:1}); // with object literal
+</pre><p>There are no upper limits for the amounts, so you can overload any of the parameters.</p><pre>moment().add('milliseconds', 1000000); // a million milliseconds
+moment().add('days', 360); // 360 days
+</pre><h4>Special considerations for months and years</h4><p>If the day of the month on the original date is greater than the number of days in the final month, the day of the month will change to the last day in the final month.
+</p><p>Example:</p><pre>moment([2010, 0, 31]); // January 31
+moment([2010, 0, 31]).add('months', 1); // February 28
+</pre><a name="/manipulation/subtract"></a><h3><span>Subtracting Time</span></h3><p>This is exactly the same as <code>moment.fn.add</code>, only instead of adding time, it subtracts time.
+</p><pre>moment().subtract('days', 7);</pre><a name="/manipulation/seconds"></a><h3><span>Seconds</span></h3><p>There are a number of shortcut getter and setter functions. Much like in jQuery, calling the function without paremeters causes it to function as a getter,
+and calling with a parameter causes it to function as a setter.
+</p><p>These map to the corresponding function on the native <code>Date</code>object.
+</p><pre>moment().seconds(30) === new Date().setSeconds(30);
+moment().seconds() === new Date().getSeconds();
+</pre><a name="/manipulation/minutes"></a><h3><span>Minutes</span></h3><pre>moment().minutes(30); // set the minutes to 30</pre><a name="/manipulation/hours"></a><h3><span>Hours</span></h3><pre>moment().hours(12); // set the hours to 12</pre><a name="/manipulation/day"></a><h3><span>Day</span></h3><pre>moment().day(5); // set the day to 5</pre><a name="/manipulation/month"></a><h3><span>Month</span></h3><pre>moment().month(5); // set the month to June</pre><a name="/manipulation/year"></a><h3><span>Year</span></h3><pre>moment().year(1984); // set the year to 1984</pre><a name="/display"></a><h2><span>Display</span></h2><p>Once parsing and manipulation are done, you need some way to display the moment. Moment.js offers many ways of doing that.</p><a name="/display/format"></a><h3><span>Formatted Date</span></h3><p>The most robust display option is <code>moment.fn.format</code>. It takes a string of tokens and replaces them with their corresponding values from the Date object.
+</p><pre>var date = new Date(2010, 1, 14, 15, 25, 50, 125);
+moment(date).format("dddd, MMMM Do YYYY, h:mm:ss a"); // "Sunday, February 14th 2010, 3:25:50 pm"
+moment(date).format("ddd, hA"); // "Sun, 3PM"
+</pre><table><tbody><tr><th>Token</th><th>Output</th></tr><tr><td><b>Month</b></td><td></td></tr><tr><td>M</td><td>1 2 ... 11 12</td></tr><tr><td>Mo</td><td>1st 2nd ... 11th 12th</td></tr><tr><td>MM</td><td>01 02 ... 11 12</td></tr><tr><td>MMM</td><td>Jan Feb ... Nov Dec</td></tr><tr><td>MMMM</td><td>January February ... November December</td></tr><tr><td><b>Day of Month</b></td><td></td></tr><tr><td>D</td><td>1 2 ... 30 30</td></tr><tr><td>Do</td><td>1st 2nd ... 30th 31st</td></tr><tr><td>DD</td><td>01 02 ... 30 31</td></tr><tr><td><b>Day of Year</b></td><td></td></tr><tr><td>DDD</td><td>1 2 ... 364 365</td></tr><tr><td>DDDo</td><td>1st 2nd ... 364th 365th</td></tr><tr><td>DDDD</td><td>001 002 ... 364 365</td></tr><tr><td><b>Day of Week</b></td><td></td></tr><tr><td>d</td><td>0 1 ... 5 6</td></tr><tr><td>do</td><td>0th 1st ... 5th 6th</td></tr><tr><td>ddd</td><td>Sun Mon ... Fri Sat</td></tr><tr><td>dddd</td><td>Sunday Monday ... Friday Saturday</td></tr><tr><td><b>Week of Year</b></td><td></td></tr><tr><td>w</td><td>1 2 ... 52 53</td></tr><tr><td>wo</td><td>1st 2nd ... 52nd 53rd</td></tr><tr><td>ww</td><td>01 02 ... 52 53</td></tr><tr><td><b>Year</b></td><td></td></tr><tr><td>YY</td><td>70 71 ... 29 30</td></tr><tr><td>YYYY</td><td>1970 1971 ... 2029 2030</td></tr><tr><td><b>AM/PM</b></td><td></td></tr><tr><td>A</td><td>AM PM</td></tr><tr><td>a</td><td>am pm</td></tr><tr><td><b>Hour</b></td><td></td></tr><tr><td>H</td><td>0 1 ... 22 23</td></tr><tr><td>HH</td><td>00 01 ... 22 23</td></tr><tr><td>h</td><td>1 2 ... 11 12</td></tr><tr><td>hh</td><td>01 02 ... 11 12</td></tr><tr><td><b>Minute</b></td><td></td></tr><tr><td>m</td><td>0 1 ... 58 59</td></tr><tr><td>mm</td><td>00 01 ... 58 59</td></tr><tr><td><b>Second</b></td><td></td></tr><tr><td>s</td><td>0 1 ... 58 59</td></tr><tr><td>ss</td><td>00 01 ... 58 59</td></tr><tr><td><b>Timezone</b></td><td></td></tr><tr><td>z</td><td>EST CST ... MST PST</td></tr><tr><td><b>Localized date format</b></td><td></td></tr><tr><td>L</td><td>07/10/1986</td></tr><tr><td>LL</td><td>July 10 1986</td></tr><tr><td>LLL</td><td>July 10 1986 8:30 PM</td></tr><tr><td>LLLL</td><td>Saturday, July 10 1986 8:30 PM</td></tr></tbody></table><a name="/display/from"></a><h3><span>Time from another moment</span></h3><p>Another common way of displaying time, sometimes called timeago, is handled by <code>moment.fn.from</code>.
+</p><pre>var a = moment([2007, 0, 29]);
+var b = moment([2007, 0, 28]);
+a.from(b) // "a day ago"
+</pre><p>The first parameter is anything you can pass to <code>moment()</code>or a Moment.js object.
+</p><pre>var a = moment([2007, 0, 29]);
+var b = moment([2007, 0, 28]);
+a.from(b); // "a day ago"
+a.from([2007, 0, 28]); // "a day ago"
+a.from(new Date(2007, 0, 28)); // "a day ago"
+a.from("1-28-2007"); // "a day ago"
+</pre><p>NOTE: Because it only accepts one parameter to pass in the date info, if you need to use String + Format or String + Formats, you should create a Moment.js
+object first and then call
+<code>moment.fn.from</code></p><pre>var a = moment();
+var b = moment("10-10-1900", "MM-DD-YYYY");
+a.from(b);
+</pre><p>If you pass <code>true</code>as the second parameter, you can get the value without the suffix. This is useful wherever you need to have a human readable length of time.
+</p><pre>var start = moment([2007, 0, 5]);
+var end = moment([2007, 0, 10]);
+start.from(end); // "in 5 days"
+start.from(end, true); // "5 days"
+</pre><p>The base strings are customized by <code>moment.lang</code>or by modifying the values directly using
+<code>moment.relativeTime</code>.
+</p><p>The breakdown of which string is displayed when is outlined in the table below.</p><table><thead><tr><th>Range</th><th>Key</th><th>Sample Output</th></tr></thead><tbody><tr><td>0 to 45 seconds</td><td>s</td><td>seconds ago</td></tr><tr><td>45 to 90 seconds</td><td>m</td><td>a minute ago</td></tr><tr><td>90 seconds to 45 minutes</td><td>mm</td><td>2 minutes ago ... 45 minutes ago</td></tr><tr><td>45 to 90 minutes</td><td>h</td><td>an hour ago</td></tr><tr><td>90 minutes to 22 hours </td><td>hh</td><td>2 hours ago ... 22 hours ago</td></tr><tr><td>22 to 36 hours</td><td>d</td><td>a day ago</td></tr><tr><td>36 hours to 25 days</td><td>dd</td><td>2 days ago ... 25 days ago</td></tr><tr><td>25 to 45 days</td><td>M</td><td>a month ago</td></tr><tr><td>45 to 345 days</td><td>MM</td><td>2 months ago ... 11 months ago</td></tr><tr><td>345 to 547 days (1.5 years)</td><td>y</td><td>a year ago</td></tr><tr><td>548 days+</td><td>yy</td><td>2 years ago ... 20 years ago</td></tr></tbody></table><a name="/display/fromNow"></a><h3><span>Time from now</span></h3><p>This is just a map to <code>moment.fn.from(new Date())</code></p><pre>moment([2007, 0, 29]).fromNow(); // 4 years ago</pre><p>Like <code>moment.fn.from</code>, if you pass
+<code>true</code>as the second parameter, you can get the value without the suffix.
+</p><pre>moment([2007, 0, 29]).fromNow(); // 4 years ago
+moment([2007, 0, 29]).fromNow(true); // 4 years
+</pre><a name="/display/diff"></a><h3><span>Difference<p>To get the difference in milliseconds, use <code>moment.fn.diff</code> like you would use <code>moment.fn.from</code>.</p>
+</span></h3><pre>var a = moment([2007, 0, 29]);
+var b = moment([2007, 0, 28]);
+a.diff(b) // 86400000
+</pre><p>To get the difference in another unit of measurement, pass that measurement as the second argument.</p><pre>var a = moment([2007, 0, 29]);
+var b = moment([2007, 0, 28]);
+a.diff(b, 'days') // 1
+</pre><p>The supported measurements are <code>"years", "months", "weeks", "days", "hours", "minutes", and "seconds"</code></p><p>By default, <code>moment.fn.diff</code>will return a rounded number. If you want the floating point number, pass
+<code>true</code>as the third argument.
+</p><pre>var a = moment([2007, 0]);
+var b = moment([2008, 5]);
+a.diff(b, 'years') // 1
+a.diff(b, 'years', true) // 1.5
+</pre><a name="/display/native"></a><h3><span>Native Date</span></h3><p>To get the native Date object that Moment.js wraps, use <code>moment.fn.native</code>.
+</p><pre>moment([2007, 0, 29]).native(); // returns native Date object</pre><a name="/display/valueOf"></a><h3><span>Value</span></h3><p><code>moment.fn.valueOf</code>simply outputs the unix timestamp.
+</p><pre>moment(1318874398806).valueOf(); // 1318874398806</pre><a name="/display/seconds"></a><h3><span>Seconds</span></h3><p>These are the getters mentioned in the <a href="#/manipulation/seconds">Manipulation</a>section above.
+</p><p>These map to the corresponding function on the native <code>Date</code>object.
+</p><pre>moment().seconds() === new Date().getSeconds();</pre><a name="/display/minutes"></a><h3><span>Minutes</span></h3><pre>moment().minutes(); // get the minutes</pre><a name="/display/hours"></a><h3><span>Hours</span></h3><pre>moment().hours(); // get the hours</pre><a name="/display/day"></a><h3><span>Day</span></h3><pre>moment().day(); // get the day </pre><a name="/display/month"></a><h3><span>Month</span></h3><pre>moment().month(); // get the month</pre><a name="/display/year"></a><h3><span>Year</span></h3><pre>moment().year(); // get the year</pre><a name="/display/leapyear"></a><h3><span>Leap Year</span></h3><p><code>moment.fn.isLeapYear</code>returns true if that year is a leap year, and false if it is not.
+</p><pre>moment([2000]).isLeapYear() // true
+moment([2001]).isLeapYear() // false
+
+moment([2100]).isLeapYear() // false
+</pre><a name="/i18n"></a><h2><span>I18N</span></h2><p>Moment.js has pretty robust support for internationalization. You can load multiple languages onto the same instance and easily switch between them.</p><a name="/i18n/lang"></a><h3><span>Changing languages</span></h3><p>By default, Moment.js comes with English language strings. If you need other languages, you can load them into Moment.js for later use.</p><p>To load a language, pass the key and the string values to <code>moment.lang</code>.
+</p><p>Note: More details on each of the parts of the language bundle can be found in the <a href="#/custom">customization</a> section.
+</p><pre>moment.lang('fr', {
+ months : "Janvier_Février_Mars_Avril_Mai_Juin_Juillet_Aout_Septembre_Octobre_Novembre_Décembre".split("_"),
+ monthsShort : "Jan_Fev_Mar_Avr_Mai_Juin_Juil_Aou_Sep_Oct_Nov_Dec".split("_"),
+ weekdays : "Dimanche_Lundi_Mardi_Mercredi_Jeudi_Vendredi_Samedi".split("_"),
+ weekdaysShort : "Dim_Lun_Mar_Mer_Jeu_Ven_Sam".split("_"),
+ longDateFormat : {
+ L : "DD/MM/YYYY",
+ LL : "D MMMM YYYY",
+ LLL : "D MMMM YYYY HH:mm",
+ LLLL : "dddd, D MMMM YYYY HH:mm"
+ },
+ relativeTime : {
+ future : "in %s",
+ past : "il y a %s",
+ s : "secondes",
+ m : "une minute",
+ mm : "%d minutes",
+ h : "une heure",
+ hh : "%d heures",
+ d : "un jour",
+ dd : "%d jours",
+ M : "un mois",
+ MM : "%d mois",
+ y : "une année",
+ yy : "%d années"
+ },
+ ordinal : function (number) {
+ return (~~ (number % 100 / 10) === 1) ? 'er' : 'ème';
+ }
+});
+</pre><p>Once you load a language, it becomes the active language. To change active languages, simply call <code>moment.lang</code>with the key of a loaded language.
+</p><pre>moment.lang('fr');moment(1316116057189).fromNow() // il y a une heure
+moment.lang('en');
+moment(1316116057189).fromNow() // an hour ago
+</pre><a name="/i18n/node"></a><h3><span>Loading languages in NodeJS</span></h3><p>Loading languages in NodeJS is super easy. If there is a language file in <code>moment/lang/</code>named after that key, the first call to
+<code>moment.lang</code>will load it.
+</p><pre>var moment = require('moment');
+moment.lang('fr');
+
+moment(1316116057189).fromNow(); // il y a une heure
+</pre><p>Right now, there is only support for English, French, Italian, and Portuguese. If you want your language supported, create a pull request or send me an email with the
+<a href="#/i18n/add">required files</a>.
+</p><a name="/i18n/browser"></a><h3><span>Loading languages in the browser</span></h3><p>Loading languages in the browser just requires you to include the language files.</p><pre><script src="moment.min.js"></script>
+<script src="lang/fr.js"></script>
+<script src="lang/pt.js"></script>
+</pre><p>There are minified versions of each of these languages. There is also a minified version of all of the languages bundled together.</p><pre><script src="moment.min.js"></script><script src="lang/all.min.js"></script>
+</pre><p>Ideally, you would bundle all the files you need into one file to minimize http requests.</p><pre><script src="moment-fr-it.min.js"></script></pre><a name="/i18n/add"></a><h3><span>Adding your language to Moment.js</span></h3><p>To add your language to Moment.js, submit a pull request with both a language file and a test file. You can find examples in <code>moment/lang/fr.js</code>and
+<code>moment/test/lang/fr.js</code></p><p>To run the tests, do <code>node build</code>.
+</p><p>If there are no errors building, then do <code>node test</code>or open
+<code>moment/test/index.html</code>.
+</p><p>If all the tests pass, submit that pull request, and thank you for contributing!</p><a name="/custom"></a><h2><span>Customization</span></h2><p>If you don't need i18n support, you can manually override the customization values. However, any calls to
+<code>moment.lang</code>will override them. It is probably safer to create a language for your specific customizations than to override these values manually.
+</p><a name="/custom/months"></a><h3><span>Month Names</span></h3><p><code>moment.months</code>should be an array of the month names.
+</p><pre>moment.months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];</pre><a name="/custom/monthsShort"></a><h3><span>Month Abbreviations</span></h3><p><code>moment.monthsShort</code>should be an array of the month abbreviations.
+</p><pre>moment.monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];</pre><a name="/custom/weekdays"></a><h3><span>Weekday Names</span></h3><p><code>moment.weekdays</code>should be an array of the weekdays names.
+</p><pre>moment.weekdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];</pre><a name="/custom/weekdaysShort"></a><h3><span>Weekday Abbreviations</span></h3><p><code>moment.weekdaysShort</code>should be an array of the weekdays abbreviations.
+</p><pre>moment.weekdaysShort = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];</pre><a name="/custom/longDateFormats"></a><h3><span>Long Date Formats</span></h3><p><code>moment.longDateFormat</code>should be an object containing a key/value pair for each long date format (L, LL, LLL, LLLL).
+</p><pre>moment.longDateFormat = {
+ L: "MM/DD/YYYY",
+ LL: "MMMM D YYYY",
+ LLL: "MMMM D YYYY h:mm A",
+ LLLL: "dddd, MMMM D YYYY h:mm A"
+};
+</pre><a name="/custom/relativeTime"></a><h3><span>Relative Time</span></h3><p><code>moment.relativeTime</code>should be an object of the replacement strings for
+<code>moment.fn.from</code>.
+</p><pre>moment.relativeTime = {
+ future: "in %s",
+ past: "%s ago",
+ s: "seconds",
+ m: "a minute",
+ mm: "%d minutes",
+ h: "an hour",
+ hh: "%d hours",
+ d: "a day",
+ dd: "%d days",
+ M: "a month",
+ MM: "%d months",
+ y: "a year",
+ yy: "%d years"
+};
+</pre><p><code>future</code>refers to the prefix/suffix for future dates, and
+<code>past</code>refers to the prefix/suffix for past dates. For all others, a single character refers to the singular, and an double character refers to the plural.
+</p><a name="/custom/ordinal"></a><h3><span>Ordinal</span></h3><p><code>moment.ordinal</code>should be a function that returns the ordinal for a given number.
+</p><pre>moment.ordinal = function (number) {
+ var b = number % 10;
+ return (~~ (number % 100 / 10) === 1) ? 'th' :
+ (b === 1) ? 'st' :
+ (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"></script></body></html>
\ No newline at end of file
link(rel="stylesheet", href="../css/style.css")
block scripts
- script(src="js/home.min.js")
+ script(src="../js/docs.min.js")
block content
#docnav
li
a(href="#/get-it/npm") npm
h2
- a(href="#/get-it")
- span Get it
+ a(href="#/use-it")
+ span Use it
ul
li
a(href="#/use-it/node") In NodeJS
li
a(href="#/custom/ordinal") Ordinal
#docs
- h1 Moment.js
+ h1 Moment.js Documentation
p A lightweight javascript date library for parsing, manipulating, and formatting dates.
- p It doesn't modify the native
- code Date.prototype
- | so it's safe to drop into any project.
a(name="/get-it")
a(name="/use-it/browser")
h3
span In the browser
- pre <script src="moment.min.js"></script>\n
+ pre <script src="moment.min.js"></script>\n
| moment().add('hours', 1).fromNow(); // "1 hour ago"
span Javascript Date Object
p A native Javascript Date object.
pre var day = new Date(2011, 9, 16);\n
- | var dayWrapper = moment(day); \n
- | \n
- | var otherDay = moment(new Date(2020, 3, 7));
+ | var dayWrapper = moment(day);
+ pre var otherDay = moment(new Date(2020, 3, 7));
p This is the fastest way to get a Moment.js wrapper.
span Javascript Array
p An array mirroring the parameters passed into
a(href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/UTC") Date.UTC()
- pre // [year, month = 0, date = 1, hours = 0, minutes = 0, seconds = 0, milliseconds = 0] \n
+ pre [year, month = 0, date = 1, hours = 0, minutes = 0, seconds = 0, milliseconds = 0]
| var day = moment([2010, 1, 14, 15, 25, 50, 125]); // February 14th, 3:25:50.125 PM
p Any value past the year is optional, and will default to the lowest possible number.
pre var day = moment([2010]); // January 1st \n
- | var day = moment([2010, 6]); // July 1st \n
+ | var day = moment([2010, 6]); // July 1st
| var day = moment([2010, 6, 10]); // July 10th
a(name="/manipulation/subtract")
- h2
+ h3
span Subtracting Time
p This is exactly the same as
code moment.fn.add
code moment.fn.format
| . It takes a string of tokens and replaces them with their corresponding values from the Date object.
pre var date = new Date(2010, 1, 14, 15, 25, 50, 125);\n
- | moment(date).format("dddd, MMMM Do YYYY, h:mm:ss a"); // "Sunday, February 14th 2010, 3:25:50 pm"\n
+ | moment(date).format("dddd, MMMM Do YYYY, h:mm:ss a"); // "Sunday, February 14th 2010, 3:25:50 pm"
| moment(date).format("ddd, hA"); // "Sun, 3PM"
table
tbody
code moment.fn.from
| .
pre var a = moment([2007, 0, 29]);\n
- | var b = moment([2007, 0, 28]);\n
+ | var b = moment([2007, 0, 28]);
| a.from(b) // "a day ago"
p The first parameter is anything you can pass to
code moment()
| or a Moment.js object.
pre var a = moment([2007, 0, 29]);\n
- | var b = moment([2007, 0, 28]);\n
- | a.from(b); // "a day ago"\n
- | a.from([2007, 0, 28]); // "a day ago"\n
- | a.from(new Date(2007, 0, 28)); // "a day ago"\n
- | a.from("1-28-2007"); // "a day ago"\n
+ | var b = moment([2007, 0, 28]);
+ | a.from(b); // "a day ago"
+ | a.from([2007, 0, 28]); // "a day ago"
+ | a.from(new Date(2007, 0, 28)); // "a day ago"
+ | a.from("1-28-2007"); // "a day ago"
p NOTE: Because it only accepts one parameter to pass in the date info,
| if you need to use String + Format or String + Formats, you should create a Moment.js
| object first and then call
code moment.fn.from
pre var a = moment();\n
- | var b = moment("10-10-1900", "MM-DD-YYYY");\n
+ | var b = moment("10-10-1900", "MM-DD-YYYY");
| a.from(b);
p If you pass
code true
| as the second parameter, you can get the value without the suffix. This is useful wherever you need to have a human readable length of time.
pre var start = moment([2007, 0, 5]);\n
- | var end = moment([2007, 0, 10]);\n
- | start.from(end); // "in 5 days"\n
+ | var end = moment([2007, 0, 10]);
+ | start.from(end); // "in 5 days"
| start.from(end, true); // "5 days"
p The base strings are customized by
code moment.lang
span Difference
<p>To get the difference in milliseconds, use <code>moment.fn.diff</code> like you would use <code>moment.fn.from</code>.</p>
pre var a = moment([2007, 0, 29]);\n
- | var b = moment([2007, 0, 28]);\n
+ | var b = moment([2007, 0, 28]);
| a.diff(b) // 86400000
p To get the difference in another unit of measurement, pass that measurement as the second argument.
pre var a = moment([2007, 0, 29]);\n
- | var b = moment([2007, 0, 28]);\n
+ | var b = moment([2007, 0, 28]);
| a.diff(b, 'days') // 1
p The supported measurements are
code "years", "months", "weeks", "days", "hours", "minutes", and "seconds"
code true
| as the third argument.
pre var a = moment([2007, 0]);\n
- | var b = moment([2008, 5]);\n
- | a.diff(b, 'years') // 1\n
+ | var b = moment([2008, 5]);
+ | a.diff(b, 'years') // 1
| a.diff(b, 'years', true) // 1.5
a(href="#/custom") customization
| section.
pre moment.lang('fr', {\n
- | months : "Janvier_Février_Mars_Avril_Mai_Juin_Juillet_Aout_Septembre_Octobre_Novembre_Décembre".split("_"),\n
- | monthsShort : "Jan_Fev_Mar_Avr_Mai_Juin_Juil_Aou_Sep_Oct_Nov_Dec".split("_"),\n
- | weekdays : "Dimanche_Lundi_Mardi_Mercredi_Jeudi_Vendredi_Samedi".split("_"),\n
- | weekdaysShort : "Dim_Lun_Mar_Mer_Jeu_Ven_Sam".split("_"),\n
- | longDateFormat : { \n
- | L : "DD/MM/YYYY",\n
- | LL : "D MMMM YYYY",\n
- | LLL : "D MMMM YYYY HH:mm",\n
- | LLLL : "dddd, D MMMM YYYY HH:mm"\n
- | },\n
- | relativeTime : {\n
- | future : "in %s",\n
- | past : "il y a %s",\n
- | s : "secondes",\n
- | m : "une minute",\n
- | mm : "%d minutes",\n
- | h : "une heure",\n
- | hh : "%d heures",\n
- | d : "un jour",\n
- | dd : "%d jours",\n
- | M : "un mois",\n
- | MM : "%d mois",\n
- | y : "une année",\n
- | yy : "%d années"\n
- | },\n
- | ordinal : function (number) {\n
- | return (~~ (number % 100 / 10) === 1) ? 'er' : 'ème';\n
- | }\n
+ | months : "Janvier_Février_Mars_Avril_Mai_Juin_Juillet_Aout_Septembre_Octobre_Novembre_Décembre".split("_"),
+ | monthsShort : "Jan_Fev_Mar_Avr_Mai_Juin_Juil_Aou_Sep_Oct_Nov_Dec".split("_"),
+ | weekdays : "Dimanche_Lundi_Mardi_Mercredi_Jeudi_Vendredi_Samedi".split("_"),
+ | weekdaysShort : "Dim_Lun_Mar_Mer_Jeu_Ven_Sam".split("_"),
+ | longDateFormat : {
+ | L : "DD/MM/YYYY",
+ | LL : "D MMMM YYYY",
+ | LLL : "D MMMM YYYY HH:mm",
+ | LLLL : "dddd, D MMMM YYYY HH:mm"
+ | },
+ | relativeTime : {
+ | future : "in %s",
+ | past : "il y a %s",
+ | s : "secondes",
+ | m : "une minute",
+ | mm : "%d minutes",
+ | h : "une heure",
+ | hh : "%d heures",
+ | d : "un jour",
+ | dd : "%d jours",
+ | M : "un mois",
+ | MM : "%d mois",
+ | y : "une année",
+ | yy : "%d années"
+ | },
+ | ordinal : function (number) {
+ | return (~~ (number % 100 / 10) === 1) ? 'er' : 'ème';
+ | }
| });
p Once you load a language, it becomes the active language. To change active languages, simply call
code moment.lang
| moment(1316116057189).fromNow() // il y a une heure
| moment.lang('en');
| moment(1316116057189).fromNow() // an hour ago
-</pre>
- </p>
+
+
a(name="/i18n/node")
h3
span Loading languages in NodeJS
- <p>Loading languages in NodeJS is super easy. If there is a language file in <code>moment/lang/</code> named after that key, the first call to <code>moment.lang</code> will load it.</p>
- pre var moment = require('moment');
-moment.lang('fr');
-moment(1316116057189).fromNow(); // il y a une heure
-</pre>
- </p>
- <p>Right now, there is only support for English, French, Italian, and Portuguese. If you want your language supported, create a pull request or send me an email with the <a href="#/i18n/add">required files</a>.</p>
+ p Loading languages in NodeJS is super easy. If there is a language file in
+ code moment/lang/
+ | named after that key, the first call to
+ code moment.lang
+ | will load it.
+ pre var moment = require('moment');\n
+ | moment.lang('fr');\n
+ | moment(1316116057189).fromNow(); // il y a une heure
+ p Right now, there is only support for English, French, Italian, and Portuguese.
+ | If you want your language supported, create a pull request or send me an email with the
+ a(href="#/i18n/add") required files
+ | .
+
+
a(name="/i18n/browser")
h3
span Loading languages in the browser
- <p>Loading languages in the browser just requires you to include the language files.</p>
- pre <script src="moment.min.js"></script>
-<script src="lang/fr.js"></script>
-<script src="lang/pt.js"></script>
-</pre>
- </p>
- <p>There are minified versions of each of these languages. There is also a minified version of all of the languages bundled together.</p>
- pre <script src="moment.min.js"></script>
-<script src="lang/all.min.js"></script>
-</pre>
- </p>
- <p>Ideally, you would bundle all the files you need into one file to minimize http requests.</p>
- pre <script src="moment-fr-it.min.js"></script>
-</pre>
- </p>
+ p Loading languages in the browser just requires you to include the language files.
+ pre <script src="moment.min.js"></script>\n
+ | <script src="lang/fr.js"></script>
+ | <script src="lang/pt.js"></script>
+ p There are minified versions of each of these languages. There is also a minified version of all of the languages bundled together.
+ pre <script src="moment.min.js"></script>
+ | <script src="lang/all.min.js"></script>
+ p Ideally, you would bundle all the files you need into one file to minimize http requests.
+ pre <script src="moment-fr-it.min.js"></script>
+
+
a(name="/i18n/add")
h3
span Adding your language to Moment.js
- <p>To add your language to Moment.js, submit a pull request with both a language file and a test file. You can find examples in <code>moment/lang/fr.js</code> and <code>moment/test/lang/fr.js</code></p>
- <p>To run the tests, do <code>node build</code>.</p>
- <p>If there are no errors building, then do <code>node test</code> or open <code>moment/test/index.html</code>.</p>
- <p>If all the tests pass, submit that pull request, and thank you for contributing!</p>
+ p To add your language to Moment.js, submit a pull request with both a language file and a test file. You can find examples in
+ code moment/lang/fr.js
+ | and
+ code moment/test/lang/fr.js
+ p To run the tests, do
+ code node build
+ | .
+ p If there are no errors building, then do
+ code node test
+ | or open
+ code moment/test/index.html
+ | .
+ p If all the tests pass, submit that pull request, and thank you for contributing!
+
+
a(name="/custom")
- <h1>Customization
- <p>If you don't need i18n support, you can manually override the customization values. However, any calls to <code>moment.lang</code> will override them. It is probably safer to create a language for your specific customizations than to override these values manually.</p>
+ h2
+ span Customization
+ p If you don't need i18n support, you can manually override the customization values.
+ | However, any calls to
+ code moment.lang
+ | will override them. It is probably safer to create a language for your specific customizations than to override these values manually.
+
+
a(name="/custom/months")
h3
span Month Names
- <p><code>moment.months</code> should be an array of the month names.</p>
+ p
+ code moment.months
+ | should be an array of the month names.
pre moment.months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
-</pre>
- </p>
+
+
a(name="/custom/monthsShort")
h3
span Month Abbreviations
- <p><code>moment.monthsShort</code> should be an array of the month abbreviations.</p>
+ p
+ code moment.monthsShort
+ | should be an array of the month abbreviations.
pre moment.monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
-</pre>
- </p>
+
+
a(name="/custom/weekdays")
h3
span Weekday Names
- <p><code>moment.weekdays</code> should be an array of the weekdays names.</p>
+ p
+ code moment.weekdays
+ | should be an array of the weekdays names.
pre moment.weekdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
-</pre>
- </p>
+
+
a(name="/custom/weekdaysShort")
h3
span Weekday Abbreviations
- <p><code>moment.weekdaysShort</code> should be an array of the weekdays abbreviations.</p>
+ p
+ code moment.weekdaysShort
+ | should be an array of the weekdays abbreviations.
pre moment.weekdaysShort = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
-</pre>
+
+
a(name="/custom/longDateFormats")
h3
span Long Date Formats
- <p><code>moment.longDateFormat</code> should be an object containing a key/value pair for each long date format (L, LL, LLL, LLLL).</p>
- pre moment.longDateFormat = {
- L: "MM/DD/YYYY",
- LL: "MMMM D YYYY",
- LLL: "MMMM D YYYY h:mm A",
- LLLL: "dddd, MMMM D YYYY h:mm A"
-};
-</pre>
- </p>
+ p
+ code moment.longDateFormat
+ | should be an object containing a key/value pair for each long date format (L, LL, LLL, LLLL).
+ pre moment.longDateFormat = { \n
+ | L: "MM/DD/YYYY",
+ | LL: "MMMM D YYYY",
+ | LLL: "MMMM D YYYY h:mm A",
+ | LLLL: "dddd, MMMM D YYYY h:mm A"
+ | };
+
+
a(name="/custom/relativeTime")
h3
span Relative Time
- <p><code>moment.relativeTime</code> should be an object of the replacement strings for <code>moment.fn.from</code>.</p>
- pre moment.relativeTime = {
- future: "in %s",
- past: "%s ago",
- s: "seconds",
- m: "a minute",
- mm: "%d minutes",
- h: "an hour",
- hh: "%d hours",
- d: "a day",
- dd: "%d days",
- M: "a month",
- MM: "%d months",
- y: "a year",
- yy: "%d years"
-};
-</pre>
- </p>
- <p><code>future</code> refers to the prefix/suffix for future dates, and <code>past</code> refers to the prefix/suffix for past dates. For all others, a single character refers to the singular, and an double character refers to the plural.</p>
+ p
+ code moment.relativeTime
+ | should be an object of the replacement strings for
+ code moment.fn.from
+ | .
+ pre moment.relativeTime = {\n
+ | future: "in %s",
+ | past: "%s ago",
+ | s: "seconds",
+ | m: "a minute",
+ | mm: "%d minutes",
+ | h: "an hour",
+ | hh: "%d hours",
+ | d: "a day",
+ | dd: "%d days",
+ | M: "a month",
+ | MM: "%d months",
+ | y: "a year",
+ | yy: "%d years"
+ | };
+ p
+ code future
+ | refers to the prefix/suffix for future dates, and
+ code past
+ | refers to the prefix/suffix for past dates. For all others, a single character refers to the singular, and an double character refers to the plural.
+
+
a(name="/custom/ordinal")
h3
span Ordinal
- <p><code>moment.ordinal</code> should be a function that returns the ordinal for a given number.</p>
- pre moment.ordinal = function (number) {
- var b = number % 10;
- return (~~ (number % 100 / 10) === 1) ? 'th' :
- (b === 1) ? 'st' :
- (b === 2) ? 'nd' :
- (b === 3) ? 'rd' : 'th';
-};
-</pre>
- </p>
- <p>For more information on ordinal numbers, see <a href="http://en.wikipedia.org/wiki/Ordinal_number_%28linguistics%29">wikipedia</a></p>
- </div>*/
\ No newline at end of file
+ p
+ code moment.ordinal
+ | should be a function that returns the ordinal for a given number.
+ pre moment.ordinal = function (number) {\n
+ | var b = number % 10;
+ | return (~~ (number % 100 / 10) === 1) ? 'th' :
+ | (b === 1) ? 'st' :
+ | (b === 2) ? 'nd' :
+ | (b === 3) ? 'rd' : 'th';
+ | };
+ p For more information on ordinal numbers, see
+ a(href="http://en.wikipedia.org/wiki/Ordinal_number_%28linguistics%29") wikipedia
+ .footer
\ No newline at end of file