Skip to content

Commit 0ced9d5

Browse files
committed
Rename "timezone-display::name" to "id"
Other possibilities: "tzid", "iana-id", "identifier", "iana-identifier". Returning a user-displayable name as part of timezone-display would require more information: the user's preferred language, and the preferred style for the name: - abbreviated or not - year-round or specific to the Instant E.g., the time zone with the IANA id "America/Los_Angeles" might be displayed as "Pacific Time", "Pacific Standard Time", "Pacific Daylight Time", "PT", "PST", "PDT", "Nordamerikanische Westküstenzeit"... The Rust iana_time_zone crate uses IANA time zone IDs, so if this interface needs to be able to implement iana_time_zone, timezone-display should have an IANA ID and not a user-displayable name.
1 parent 3921fca commit 0ced9d5

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ default-monotonic-clock: monotonic-clock
9292

9393
let timezone_display: TimezoneDisplay = timezone::display(instant);
9494

95-
println!("the timezone is {}", timezone_display.name);
95+
println!("the timezone is {}", timezone_display.id);
9696
```
9797

9898
### Detailed design discussion

imports.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,12 @@ number of seconds in a day (24<em>60</em>60).</p>
180180
should return 0.</p>
181181
</li>
182182
<li>
183-
<p><a name="timezone_display.name"></a><code>name</code>: <code>string</code></p>
184-
<p>The abbreviated name of the timezone to display to a user. The name
185-
`UTC` indicates Coordinated Universal Time. Otherwise, this should
186-
reference local standards for the name of the time zone.
183+
<p><a name="timezone_display.id"></a><code>id</code>: <code>string</code></p>
184+
<p>The IANA identifier of the timezone. The id `UTC` indicates
185+
Coordinated Universal Time. Otherwise, this should be an identifier
186+
from the IANA Time Zone Database.
187+
<p>For displaying to a user, the identifier should be converted into a
188+
localized name by means of an internationalization API.</p>
187189
<p>In implementations that do not expose an actual time zone, this
188190
should be the string <code>UTC</code>.</p>
189191
<p>In time zones that do not have an applicable name, a formatted

wit/timezone.wit

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,18 @@ interface timezone {
3232
/// should return 0.
3333
utc-offset: s32,
3434

35-
/// The abbreviated name of the timezone to display to a user. The name
36-
/// `UTC` indicates Coordinated Universal Time. Otherwise, this should
37-
/// reference local standards for the name of the time zone.
35+
/// The IANA identifier of the timezone. The id `UTC` indicates
36+
/// Coordinated Universal Time. Otherwise, this should be an identifier
37+
/// from the IANA Time Zone Database.
38+
///
39+
/// For displaying to a user, the identifier should be converted into a
40+
/// localized name by means of an internationalization API.
3841
///
3942
/// In implementations that do not expose an actual time zone, this
4043
/// should be the string `UTC`.
4144
///
4245
/// In time zones that do not have an applicable name, a formatted
4346
/// representation of the UTC offset may be returned, such as `-04:00`.
44-
name: string,
47+
id: string,
4548
}
4649
}

0 commit comments

Comments
 (0)