Skip to content

Commit

Permalink
fix issue #213 iso date format inversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred Sawaya committed Aug 6, 2017
1 parent ec47269 commit fca5b6b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/output/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,28 +170,28 @@ impl ISOFormat {
let date = LocalDateTime::at(time.seconds as i64);

if self.is_recent(date) {
format!("{:04}-{:02}-{:02}",
date.year(), date.month() as usize, date.day())
}
else {
format!("{:02}-{:02} {:02}:{:02}",
date.month() as usize, date.day(),
date.hour(), date.minute())
}
else {
format!("{:04}-{:02}-{:02}",
date.year(), date.month() as usize, date.day())
}
}

#[allow(trivial_numeric_casts)]
fn format_zoned(&self, time: Time, zone: &TimeZone) -> String {
let date = zone.to_zoned(LocalDateTime::at(time.seconds as i64));

if self.is_recent(date) {
format!("{:04}-{:02}-{:02}",
date.year(), date.month() as usize, date.day())
}
else {
format!("{:02}-{:02} {:02}:{:02}",
date.month() as usize, date.day(),
date.hour(), date.minute())
}
else {
format!("{:04}-{:02}-{:02}",
date.year(), date.month() as usize, date.day())
}
}
}

0 comments on commit fca5b6b

Please sign in to comment.