mirror of
https://github.com/Llewellynvdm/exa.git
synced 2025-04-07 16:01:52 +00:00
Merge pull request #250 from ogham/exa/issue-213
fix issue #213 iso date format inversion
This commit is contained in:
commit
dd0c5f6bef
@ -177,14 +177,14 @@ impl ISOFormat {
|
|||||||
let date = LocalDateTime::at(time.seconds as i64);
|
let date = LocalDateTime::at(time.seconds as i64);
|
||||||
|
|
||||||
if self.is_recent(date) {
|
if self.is_recent(date) {
|
||||||
format!("{:04}-{:02}-{:02}",
|
|
||||||
date.year(), date.month() as usize, date.day())
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
format!("{:02}-{:02} {:02}:{:02}",
|
format!("{:02}-{:02} {:02}:{:02}",
|
||||||
date.month() as usize, date.day(),
|
date.month() as usize, date.day(),
|
||||||
date.hour(), date.minute())
|
date.hour(), date.minute())
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
format!("{:04}-{:02}-{:02}",
|
||||||
|
date.year(), date.month() as usize, date.day())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(trivial_numeric_casts)]
|
#[allow(trivial_numeric_casts)]
|
||||||
@ -192,13 +192,13 @@ impl ISOFormat {
|
|||||||
let date = zone.to_zoned(LocalDateTime::at(time.seconds as i64));
|
let date = zone.to_zoned(LocalDateTime::at(time.seconds as i64));
|
||||||
|
|
||||||
if self.is_recent(date) {
|
if self.is_recent(date) {
|
||||||
format!("{:04}-{:02}-{:02}",
|
|
||||||
date.year(), date.month() as usize, date.day())
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
format!("{:02}-{:02} {:02}:{:02}",
|
format!("{:02}-{:02} {:02}:{:02}",
|
||||||
date.month() as usize, date.day(),
|
date.month() as usize, date.day(),
|
||||||
date.hour(), date.minute())
|
date.hour(), date.minute())
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
format!("{:04}-{:02}-{:02}",
|
||||||
|
date.year(), date.month() as usize, date.day())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user