From: daurnimator Date: Fri, 29 Aug 2014 21:01:43 +0000 (-0400) Subject: doc/timetable: Document `normalise` fractional behaviour X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/ebcbc1838c17993801dc53fee28a21d05f92aacc doc/timetable: Document `normalise` fractional behaviour --- diff --git a/doc/timetable.md b/doc/timetable.md index 845c787..49fe046 100644 --- a/doc/timetable.md +++ b/doc/timetable.md @@ -39,9 +39,17 @@ Returns a new independent instance of an existing timetable object. ### `:normalise ( )` -Mutates the current object's time and date components so that they lie within 'normal' +Mutates the current object's time and date components so that are integers within 'normal' ranges e.g. `month` is `1`-`12`; `min` is `0`-`59` +First, fractional parts are propagated down. +e.g. `.month=6.5` `.day=1` (which could be read as "the first day after the middle of June") +normalises to `.month=2` `.day=16` + +Second, any fields outside of their normal ranges are propagated up +e.g. `.hour=10` `.min=100` (100 minutes past 10am) +normalises to `.hour=11` `.min=40` + ### `:rfc_3339 ( )` and `__tostring` metamethod