]> git.madduck.net Git - etc/awesome.git/blobdiff - doc/timetable.md

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

luatz/tzfile: Add luacheck annotation
[etc/awesome.git] / doc / timetable.md
index 49fe046b5a494fa7bc04e635b1152737b47898aa..812da43c711e4ab9b272cdc770e085efeefbbec6 100644 (file)
@@ -1,4 +1,4 @@
-# `luatz.timetable`
+## `luatz.timetable` <!-- --> {#timetable}
 
 Provides an class to represent a time and date.
 Objects have no concept of timezone or utc offset.
@@ -15,29 +15,29 @@ The fields are intentionally compatible with the lua standard library's `os.date
   - `wday` (optional)
   
 timetable components may be outside of their standard range (e.g. a month component of 
-14) to facilitate arithmetic operations on date components. `:normalise ( )` can be 
+14) to facilitate arithmetic operations on date components. `:normalise()` can be 
 called to modify components to return to their standard range.
 
 Equality and comparisons should work between timetable objects.
 
 
-### `new ( year , month , day , hour , min , sec , [yday] , [wday] )`
+### `new(year, month, day, hour, min, sec[, yday[, [wday]])` <!-- --> {#timetable.new}
 
 Returns a new timetable with the given contents.
 
 
-### `new_from_timestamp ( timestamp )`
+### `new_from_timestamp(timestamp)` <!-- --> {#timetable.new_from_timestamp}
 
 Returns a new (normalised) timetable, given a timestamp in seconds since the unix epoch of 
 1970-01-01.
 
 
-### `:clone ( )`
+### `timetable:clone()` <!-- --> {#timetable:clone}
 
 Returns a new independent instance of an existing timetable object.
 
 
-### `:normalise ( )`
+### `timetable:normalise()` <!-- --> {#timetable:normalise}
 
 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`
@@ -51,19 +51,21 @@ e.g. `.hour=10` `.min=100` (100 minutes past 10am)
 normalises to `.hour=11` `.min=40`
 
 
-### `:rfc_3339 ( )` and `__tostring` metamethod
+### `timetable:rfc_3339()` <!-- --> {#timetable:rfc_3339}
 
 Returns the timetable formatted as an rfc-3339 style string.
 The timezone offset (or Z) is not appended.
 The ranges of components are not checked, if you want a valid timestamp,
-`:normalise ( )` should be called first.
+[`:normalise()`](#timetable:normalise) should be called first.
 
+This function is also the `__tostring` metamethod for timetable objects
 
-### `:timestamp ( )`
+
+### `timetable:timestamp()` <!-- --> {#timetable:timestamp}
 
 Returns the timetable as the number of seconds since unix epoch (1970-01-01) as a lua number.
 
 
-### `:unpack ( )`
+### `timetable:unpack()` <!-- --> {#timetable:unpack}
 
 Unpacks the timetable object; returns `year`, `month`, `day`, `hour`, `min`, `sec`, `yday`, `wday`