Skip to content

Commit f77f01b

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 25a6243 commit f77f01b

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
@@ -181,10 +181,12 @@ number of seconds in a day (24<em>60</em>60).</p>
181181
should return 0.</p>
182182
</li>
183183
<li>
184-
<p><a name="timezone_display.name"></a><code>name</code>: <code>string</code></p>
185-
<p>The abbreviated name of the timezone to display to a user. The name
186-
`UTC` indicates Coordinated Universal Time. Otherwise, this should
187-
reference local standards for the name of the time zone.
184+
<p><a name="timezone_display.id"></a><code>id</code>: <code>string</code></p>
185+
<p>The IANA identifier of the timezone. The id `UTC` indicates
186+
Coordinated Universal Time. Otherwise, this should be an identifier
187+
from the IANA Time Zone Database.
188+
<p>For displaying to a user, the identifier should be converted into a
189+
localized name by means of an internationalization API.</p>
188190
<p>In implementations that do not expose an actual time zone, this
189191
should be the string <code>UTC</code>.</p>
190192
<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
@@ -33,15 +33,18 @@ interface timezone {
3333
/// should return 0.
3434
utc-offset: s32,
3535

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

0 commit comments

Comments
 (0)