Skip to content

Commit 95a996e

Browse files
committed
Fix datetime ISO8601 formatting (#12)
1 parent 546610c commit 95a996e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

gleam.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "gtempo"
2-
version = "6.1.0"
2+
version = "6.1.1"
33

44
# Fill out these fields if you intend to generate HTML documentation or publish
55
# your project to the Hex package manager.

src/tempo.gleam

+6-6
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub fn now_adjusted(by duration: Duration) -> DateTime {
7878
/// ## Example
7979
///
8080
/// ```gleam
81-
/// tempo.format_utc(tempo.ISO8601)
81+
/// tempo.format_utc(tempo.ISO8601Seconds)
8282
/// // -> "2024-12-26T16:32:34Z"
8383
/// ```
8484
pub fn format_utc(in format: DateTimeFormat) -> String {
@@ -90,7 +90,7 @@ pub fn format_utc(in format: DateTimeFormat) -> String {
9090
/// ## Example
9191
///
9292
/// ```gleam
93-
/// tempo.format_local(tempo.ISO8601)
93+
/// tempo.format_local(tempo.ISO8601Seconds)
9494
/// // -> "2024-12-26T12:32:34-04:00"
9595
/// ```
9696
pub fn format_local(in format: DateTimeFormat) -> String {
@@ -2884,11 +2884,11 @@ pub type Locale
28842884
@internal
28852885
pub fn get_datetime_format_str(format: DateTimeFormat) {
28862886
case format {
2887-
ISO8601Seconds -> "YYYY/MM/DDTHH:mm:ssZ"
2888-
ISO8601Milli -> "YYYY/MM/DDTHH:mm:ss.SSSZ"
2889-
ISO8601Micro -> "YYYY/MM/DDTHH:mm:ss.SSSSZ"
2887+
ISO8601Seconds -> "YYYY-MM-DDTHH:mm:ssZ"
2888+
ISO8601Milli -> "YYYY-MM-DDTHH:mm:ss.SSSZ"
2889+
ISO8601Micro -> "YYYY-MM-DDTHH:mm:ss.SSSSZ"
28902890
HTTP -> "ddd, DD MMM YYYY HH:mm:ss [GMT]"
2891-
DateFormat(ISO8601Date) -> "YYYY/MM/DD"
2891+
DateFormat(ISO8601Date) -> "YYYY-MM-DD"
28922892
TimeFormat(ISO8601Time) -> "HH:mm:ssZ"
28932893
TimeFormat(ISO8601TimeMilli) -> "HH:mm:ss.SSSZ"
28942894
TimeFormat(ISO8601TimeMicro) -> "HH:mm:ss.SSSSZ"

0 commit comments

Comments
 (0)