diff --git a/Cargo.toml b/Cargo.toml index 6c70d2d..c25ef84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ repository = "https://github.com/Alex-PK/chrono-locale" build = "build.rs" [dependencies] -chrono = "0.4" +chrono = "0.4.26" num-integer = { version = "0.1", default-features = false } lazy_static = "1.2" diff --git a/src/lib.rs b/src/lib.rs index 9b6746b..853841b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -84,13 +84,6 @@ impl LocaleDate for chrono::NaiveDateTime { } } -impl LocaleDate for chrono::Date { - fn formatl<'a>(&self, fmt: &'a str, locale: &str) -> DelayedFormatL10n> { - let offset = self.offset().fix(); - DelayedFormatL10n::new_with_offset(Some(self.naive_local()), None, &offset, StrftimeItems::new(fmt), locale) - } -} - impl LocaleDate for chrono::DateTime { fn formatl<'a>(&self, fmt: &'a str, locale: &str) -> DelayedFormatL10n> { let local = self.naive_local(); @@ -206,8 +199,7 @@ where (_, _, _) => None, }, ), - - // for the future expansion + // for the future expansion Internal(_) => (1, None), }; @@ -285,6 +277,8 @@ where TimezoneName => off.map(|&(ref name, _)| write!(w, "{}", *name)), TimezoneOffsetColon => off.map(|&(_, off)| write_local_minus_utc(w, off, false, true)), TimezoneOffsetColonZ => off.map(|&(_, off)| write_local_minus_utc(w, off, true, true)), + TimezoneOffsetDoubleColon => off.map(|&(_, off)| write_local_minus_utc(w, off, false, true)), + TimezoneOffsetTripleColon => off.map(|&(_, off)| write_local_minus_utc(w, off, false, true)), TimezoneOffset => off.map(|&(_, off)| write_local_minus_utc(w, off, false, false)), TimezoneOffsetZ => off.map(|&(_, off)| write_local_minus_utc(w, off, true, false)), RFC2822 =>