File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ pub(crate) enum Day {
4141}
4242
4343#[ derive( PartialEq , Eq , Debug ) ]
44- pub struct Weekday {
44+ pub ( crate ) struct Weekday {
4545 pub ( crate ) offset : i32 ,
4646 pub ( crate ) day : Day ,
4747}
@@ -60,6 +60,20 @@ impl From<Day> for chrono::Weekday {
6060 }
6161}
6262
63+ impl From < Day > for jiff:: civil:: Weekday {
64+ fn from ( value : Day ) -> Self {
65+ match value {
66+ Day :: Monday => jiff:: civil:: Weekday :: Monday ,
67+ Day :: Tuesday => jiff:: civil:: Weekday :: Tuesday ,
68+ Day :: Wednesday => jiff:: civil:: Weekday :: Wednesday ,
69+ Day :: Thursday => jiff:: civil:: Weekday :: Thursday ,
70+ Day :: Friday => jiff:: civil:: Weekday :: Friday ,
71+ Day :: Saturday => jiff:: civil:: Weekday :: Saturday ,
72+ Day :: Sunday => jiff:: civil:: Weekday :: Sunday ,
73+ }
74+ }
75+ }
76+
6377/// Parse a weekday item.
6478pub ( super ) fn parse ( input : & mut & str ) -> ModalResult < Weekday > {
6579 seq ! ( Weekday {
You can’t perform that action at this time.
0 commit comments