Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
rsheeter committed Sep 6, 2023
1 parent 0eab689 commit 272efce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ temp-env = "0.3.3"

[workspace]

resolver = "2"

members = [
"fontdrasil",
"fontbe",
Expand Down
5 changes: 3 additions & 2 deletions glyphs2fontir/src/source.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use chrono::{TimeZone, Utc};
use chrono::DateTime;
use font_types::{NameId, Tag};
use fontdrasil::orchestration::{Access, Work};
use fontdrasil::types::{GlyphName, GroupName};
Expand Down Expand Up @@ -366,7 +366,8 @@ impl Work<Context, WorkId, WorkError> for StaticMetadataWork {
.date
.as_ref()
.and_then(|raw_date| {
let parsed = Utc.datetime_from_str(raw_date, "%Y-%m-%d %H:%M:%S %Z");
let parsed =
DateTime::parse_from_str(raw_date, "%Y-%m-%d %H:%M:%S %z").map(|nd| nd.into());
if let Err(e) = parsed {
warn!("Invalid creation date: {}: {e:?}", raw_date);
}
Expand Down
5 changes: 3 additions & 2 deletions ufo2fontir/src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{
sync::Arc,
};

use chrono::{DateTime, TimeZone, Utc};
use chrono::{DateTime, NaiveDateTime, Utc};
use font_types::{InvalidTag, NameId, Tag};
use fontdrasil::{
orchestration::{Access, Work},
Expand Down Expand Up @@ -666,7 +666,8 @@ fn try_parse_date(raw_date: Option<&String>) -> Option<DateTime<Utc>> {
return None;
};

let parse_result = Utc.datetime_from_str(raw_date, "%Y/%m/%d %H:%M:%S");
let parse_result =
NaiveDateTime::parse_from_str(raw_date, "%Y/%m/%d %H:%M:%S").map(|nd| nd.and_utc());
if let Err(e) = parse_result {
warn!("Invalid date string {}: {e}", raw_date);
}
Expand Down

0 comments on commit 272efce

Please sign in to comment.