Use proper DateTime (from chrono) instead of i64

Use the local timezone for now.

For the proper implementation the client's timezone should be obtained,
either from users preferences, or from the browser.
This commit is contained in:
Vladan Popovic 2020-03-22 23:39:50 +01:00
parent 2d0253a83f
commit c924706163
8 changed files with 49 additions and 8 deletions

View file

@ -61,15 +61,15 @@ fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
}
fn commit_to_dom<T>(commit: &SocialCommit) -> Vec<Node<T>> {
nodes![
nodes![div![
p!(format!(
"Author: {} <{}>",
commit.author.name, commit.author.email
)),
p!(format!("Date: {}", commit.time)),
span!(format!("Date: {}", commit.time)),
p!(format!(" {}", commit.message.replace("\n", "\n "))),
hr![],
]
]]
}
fn tree_entry_to_dom<T>(te: &SocialTreeEntry) -> Vec<Node<T>> {
nodes![p![format!("{:o} | {}", te.filemode, te.name)], hr![],]