diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index abb15ec..58d8a1f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,4 +18,6 @@ jobs: ./wit-deps lock git add -N wit/deps git diff --exit-code - - uses: WebAssembly/wit-abi-up-to-date@v20 + - uses: WebAssembly/wit-abi-up-to-date@v21 + with: + features: clocks-timezone diff --git a/README.md b/README.md index 1690e32..49b40b9 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ WASI clocks must have at least two complete independent implementations. - [[Alternative 2]](#alternative-2) - [Stakeholder Interest & Feedback](#stakeholder-interest--feedback) - [References & acknowledgements](#references--acknowledgements) +- [Development](#development) ### Introduction @@ -132,3 +133,13 @@ Many thanks for valuable feedback and advice from: - [Person 1] - [Person 2] - [etc.] + +### Development + +#### Generating imports.md + +The file `imports.md` is generated using [wit-bindgen](https://github.com/bytecodealliance/wit-bindgen). + +```bash +wit-bindgen markdown wit --html-in-md --features clocks-timezone +``` diff --git a/imports.md b/imports.md index ec3bedd..b1fefd7 100644 --- a/imports.md +++ b/imports.md @@ -5,6 +5,7 @@
wasi:io/poll@0.2.0
wasi:clocks/monotonic-clock@0.2.0
wasi:clocks/wall-clock@0.2.0
wasi:clocks/timezone@0.2.0
type datetime
+#### `record timezone-display` +
Information useful for displaying the timezone of a specific datetime
.
This information may vary within a single timezone
to reflect daylight
+saving time adjustments.
utc-offset
: s32
The number of seconds difference between UTC time and the local +time of the timezone. +
The returned value will always be less than 86400 which is the +number of seconds in a day (246060).
+In implementations that do not expose an actual time zone, this +should return 0.
+The abbreviated name of the timezone to display to a user. The name +`UTC` indicates Coordinated Universal Time. Otherwise, this should +reference local standards for the name of the time zone. +
In implementations that do not expose an actual time zone, this
+should be the string UTC
.
In time zones that do not have an applicable name, a formatted
+representation of the UTC offset may be returned, such as -04:00
.
Whether daylight saving time is active. +
In implementations that do not expose an actual time zone, this +should return false.
+display: func
Return information needed to display the given datetime
. This includes
+the UTC offset, the time zone name, and a flag indicating whether
+daylight saving time is active.
If the timezone cannot be determined for the given datetime
, return a
+timezone-display
for UTC
with a utc-offset
of 0 and no daylight
+saving time.
when
: datetime
timezone-display
utc-offset: func
The same as display
, but only return the UTC offset.
when
: datetime