Improve format
I think the new format is more readable than the old one, but I might change it around again when I add colors.
This commit is contained in:
parent
29770759cb
commit
2276aae8c5
3 changed files with 178 additions and 62 deletions
|
|
@ -161,6 +161,7 @@ impl From<chrono::Weekday> for Weekday {
|
|||
}
|
||||
|
||||
impl Weekday {
|
||||
/// Short name (`mon`, `tue`, `wed`, `fri`, `sat`, `sun`).
|
||||
pub fn name(self) -> &'static str {
|
||||
match self {
|
||||
Self::Monday => "mon",
|
||||
|
|
@ -173,6 +174,20 @@ impl Weekday {
|
|||
}
|
||||
}
|
||||
|
||||
/// Full name (`Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`,
|
||||
/// `Saturday`, `Sunday`).
|
||||
pub fn full_name(self) -> &'static str {
|
||||
match self {
|
||||
Weekday::Monday => "Monday",
|
||||
Weekday::Tuesday => "Tuesday",
|
||||
Weekday::Wednesday => "Wednesday",
|
||||
Weekday::Thursday => "Thursday",
|
||||
Weekday::Friday => "Friday",
|
||||
Weekday::Saturday => "Saturday",
|
||||
Weekday::Sunday => "Sunday",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn num(self) -> u8 {
|
||||
match self {
|
||||
Self::Monday => 1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue