Skip to content

Commit 41fc468

Browse files
committed
time: apply remarks
1 parent f64e836 commit 41fc468

File tree

7 files changed

+249
-359
lines changed

7 files changed

+249
-359
lines changed

lib/time/coverage.txt

Lines changed: 0 additions & 149 deletions
This file was deleted.

lib/time/doc.go

Lines changed: 70 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,71 @@
1-
/*Package time defines time primitives for starlark, based heavily on the time
2-
package from the go standard library.
3-
4-
outline: time
5-
time defines time primitives for starlark
6-
path: time
7-
functions:
8-
parse_duration(string) duration
9-
parse a duration
10-
parse_location(string) location
11-
parse a location
12-
parse_time(string, format=..., location=...) time
13-
parse a time
14-
from_timestamp(int) time
15-
parse a Unix timestamp
16-
now() time
17-
internal call to time.Time, returns the current time by default
18-
zero() time
19-
a constant
20-
21-
types:
22-
duration
23-
fields:
24-
hours float
25-
minutes float
26-
nanoseconds int
27-
seconds float
28-
operators:
29-
duration - time = duration
30-
duration + time = time
31-
duration == duration = boolean
32-
duration < duration = booleans
33-
time
34-
functions:
35-
year duration
36-
month int
37-
day int
38-
hour int
39-
minute int
40-
second int
41-
nanosecond int
42-
unix int
43-
unix_nano int
44-
in_location(string) time
45-
get time representing the same instant but in a different location
46-
format(string) string
47-
textual representation of time formatted according to the provided
48-
layout string
49-
operators:
50-
time == time = boolean
51-
time < time = boolean
52-
time + duration = time
53-
time - duration = time
54-
time - time = duration
55-
*/
1+
// Package time defines time primitives for starlark, based heavily on the time
2+
// package from the go standard library.
3+
//
4+
// outline: time
5+
// time defines time primitives for starlark
6+
// path: time
7+
// functions:
8+
// parse_duration(string) duration
9+
// parse a duration
10+
// parse_location(string) location
11+
// parse a location
12+
// parse_time(string, format=..., location=...) time
13+
// parse a time
14+
// time(year=..., month=..., day=..., hour=..., minute=..., second=..., nanosecond=..., location=...) time
15+
// build a time
16+
// from_timestamp(int) time
17+
// parse a Unix timestamp
18+
// now() time
19+
// internal call to time.Time, returns the current time by default
20+
//
21+
// types:
22+
// duration
23+
// fields:
24+
// hours float
25+
// microseconds int
26+
// milliseconds int
27+
// minutes float
28+
// nanoseconds int
29+
// seconds float
30+
// operators:
31+
// duration == duration = boolean
32+
// duration != duration = boolean
33+
// duration < duration = boolean
34+
// duration <= duration = boolean
35+
// duration > duration = boolean
36+
// duration >= duration = boolean
37+
// duration + duration = duration
38+
// duration + time = time
39+
// duration - duration = duration
40+
// duration / duration = float
41+
// duration / int = duration
42+
// duration // duration = int
43+
// duration // int = duration
44+
// duration * int = duration
45+
// time
46+
// functions:
47+
// year duration
48+
// month int
49+
// day int
50+
// hour int
51+
// minute int
52+
// second int
53+
// nanosecond int
54+
// unix int
55+
// unix_nano int
56+
// in_location(string) time
57+
// get time representing the same instant but in a different location
58+
// format(string) string
59+
// textual representation of time formatted according to the provided
60+
// layout string
61+
// operators:
62+
// time == time = boolean
63+
// time != time = boolean
64+
// time < time = boolean
65+
// time <= time = boolean
66+
// time > time = boolean
67+
// time >= time = boolean
68+
// time + duration = time
69+
// time - duration = time
70+
// time - time = duration
5671
package time

lib/time/testdata/test.star

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)