time-rs / time

The most used Rust library for date and time handling.
https://time-rs.github.io
Apache License 2.0
1.13k stars 281 forks source link

Cannot compare weekdays #568

Closed amokfa closed 1 year ago

amokfa commented 1 year ago

This code doesn't compile:

    if now.weekday() < time::Weekday::Wednesday {

    }
jhpratt commented 1 year ago

The reason for this is documented.

As order is dependent on context (Sunday could be either two days after or five days before Friday), this type does not implement PartialOrd or Ord.