Add from_hash_map impl for Article
Signed-off-by: trivernis <trivernis@protonmail.com>main
parent
af3ba931d2
commit
2bfff98ce7
@ -0,0 +1,13 @@
|
|||||||
|
use chrono::{Date, Local};
|
||||||
|
use chrono_english::Dialect;
|
||||||
|
|
||||||
|
pub type LocalDate = Date<Local>;
|
||||||
|
|
||||||
|
pub fn parse_date(date_str: &str) -> Option<LocalDate> {
|
||||||
|
let date_str = date_str.replace('.', "/");
|
||||||
|
if let Ok(datetime) = chrono_english::parse_date_string(&date_str, Local::now(), Dialect::Us) {
|
||||||
|
Some(datetime.date())
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
pub mod date;
|
Loading…
Reference in New Issue