From: Tim Wood Date: Thu, 22 Dec 2011 17:54:44 +0000 (-0800) Subject: Adding docs for `moment.fn.day` #101 X-Git-Tag: 1.3.0~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b1a7c6faeee7cf4971a8d07ba32967f22b2c54e;p=thirdparty%2Fmoment.git Adding docs for `moment.fn.day` #101 --- diff --git a/sitesrc/docs.jade b/sitesrc/docs.jade index 0d8eb9e27..1fdbed261 100644 --- a/sitesrc/docs.jade +++ b/sitesrc/docs.jade @@ -61,6 +61,8 @@ block content a(href="#/manipulation/hours") Hours li a(href="#/manipulation/date") Date + li + a(href="#/manipulation/day") Day li a(href="#/manipulation/month") Month li @@ -456,6 +458,25 @@ block content span Date p Accepts numbers from 1 to 31 pre moment().date(5); // set the date to 5 + p NOTE: + code moment.fn.date + | is used to set the date of the month, and + code moment.fn.day + | is used to set the day of the week. + + + a(name="/manipulation/day") + h3 + span Day + pre moment().day(5); // set the day of the week to Friday + p This method can be used to set the day of the week, Sunday being 0 and Saturday being 6. + p + code moment.fn.day + | can also be overloaded to set to a weekday of the previous week, next week, or a week any distance from the moment. + pre moment().day(-7); // set to last Sunday (0 - 7) \n + | moment().day(7); // set to next Sunday (0 + 7) + | moment().day(10); // set to next Wednesday (3 + 7) + | moment().day(24); // set to 3 Wednesdays from now (3 + 7 + 7 + 7) a(name="/manipulation/month")