diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ec9258..cfc742a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ Deprecations: Enhancements: +* [#196](https://github.com/BurntSushi/jiff/discussions/196): +Improve ISO week date documentation regarding weekday offsets. * [#197](https://github.com/BurntSushi/jiff/discussions/197): Add `Zoned::iso_week_date`, `DateTime::iso_week_date` and `Date::iso_week_date`. diff --git a/src/civil/iso_week_date.rs b/src/civil/iso_week_date.rs index 13325e8..9506e0c 100644 --- a/src/civil/iso_week_date.rs +++ b/src/civil/iso_week_date.rs @@ -243,7 +243,10 @@ impl ISOWeekDate { /// Returns the day component of this ISO 8601 week date. /// /// One can use methods on `Weekday` such as - /// [`Weekday::to_sunday_zero_offset`] to convert the weekday to a number. + /// [`Weekday::to_monday_one_offset`] + /// and + /// [`Weekday::to_sunday_zero_offset`] + /// to convert the weekday to a number. /// /// # Example /// @@ -254,6 +257,10 @@ impl ISOWeekDate { /// assert_eq!(weekdate.year(), 1948); /// assert_eq!(weekdate.week(), 53); /// assert_eq!(weekdate.weekday(), Weekday::Friday); + /// assert_eq!(weekdate.weekday().to_monday_zero_offset(), 4); + /// assert_eq!(weekdate.weekday().to_monday_one_offset(), 5); + /// assert_eq!(weekdate.weekday().to_sunday_zero_offset(), 5); + /// assert_eq!(weekdate.weekday().to_sunday_one_offset(), 6); /// ``` #[inline] pub fn weekday(self) -> Weekday {