aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/time.lux
blob: 8e38a8ee923e5742cdbbabccd87686743d83e167 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
(.using
 [library
  [lux (.except and)
   ["$" documentation (.only documentation:)]
   [control
    ["<>" parser (.only)
     ["<[0]>" code]]]
   [data
    ["[0]" text (.only \n)
     ["%" \\format (.only format)]]]
   [macro
    ["[0]" template]]]]
 [\\library
  ["[0]" /]]
 ["[0]" /
  ["[1][0]" date]
  ["[1][0]" day]
  ["[1][0]" duration]
  ["[1][0]" instant]
  ["[1][0]" month]
  ["[1][0]" year]])

(with_template [<name> <doc>]
  [(documentation: <name>
     <doc>)]

  [/.milli_seconds "Number of milli-seconds in a second."]
  [/.seconds "Number of seconds in a minute."]
  [/.minutes "Number of minutes in an hour."]
  [/.hours "Number of hours in an day."]
  )

(documentation: /.Time
  "Time is defined as milliseconds since the start of the day (00:00:00.000).")

(documentation: /.midnight
  "The instant corresponding to the start of the day: 00:00:00.000")

(documentation: /.of_millis
  ""
  [(of_millis milli_seconds)])

(documentation: /.Clock
  "A clock marking the specific hour, minute, second, and milli-second in a day.")

(documentation: /.clock
  ""
  [(clock time)])

(documentation: /.time
  ""
  [(time clock)])

(documentation: /.codec
  (format "Based on ISO 8601."
          \n "For example: 21:14:51.827"))

(.def .public documentation
  (.List $.Module)
  ($.module /._
            ""
            [..milli_seconds
             ..seconds
             ..minutes
             ..hours
             ..Time
             ..midnight
             ..of_millis
             ..Clock
             ..clock
             ..time
             ..codec
             ($.default /.time_exceeds_a_day)
             ($.default /.invalid_hour)
             ($.default /.invalid_minute)
             ($.default /.invalid_second)
             ($.default /.millis)
             ($.default /.equivalence)
             ($.default /.order)
             ($.default /.enum)
             ($.default /.parser)]
            [/date.documentation
             /day.documentation
             /duration.documentation
             /instant.documentation
             /month.documentation
             /year.documentation]))