We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea3c725 commit 2451e17Copy full SHA for 2451e17
components/calendar/src/date.rs
@@ -460,6 +460,7 @@ impl<A> Copy for Date<A> where A: AsCalendar + Copy {}
460
#[cfg(test)]
461
mod tests {
462
use super::*;
463
+ use crate::types::Weekday;
464
465
#[test]
466
fn test_ord() {
@@ -489,4 +490,23 @@ mod tests {
489
490
}
491
492
493
+
494
+ #[test]
495
+ fn test_day_of_week() {
496
+ // June 23, 2021 is a Wednesday
497
+ assert_eq!(
498
+ Date::try_new_iso(2021, 6, 23).unwrap().day_of_week(),
499
+ Weekday::Wednesday,
500
+ );
501
+ // Feb 2, 1983 was a Wednesday
502
503
+ Date::try_new_iso(1983, 2, 2).unwrap().day_of_week(),
504
505
506
+ // Jan 21, 2021 was a Tuesday
507
508
+ Date::try_new_iso(2020, 1, 21).unwrap().day_of_week(),
509
+ Weekday::Tuesday,
510
511
+ }
512
0 commit comments