fix: fromUniversalTime & fromLocalTime

This commit is contained in:
Erica Marigold 2023-09-07 14:37:46 +05:30
parent 87e579ad1a
commit aa73a4b72e
No known key found for this signature in database
GPG key ID: 23CD97ABBBCC5ED2
2 changed files with 2 additions and 2 deletions

View file

@ -98,7 +98,7 @@ impl DateTimeBuilder {
{
let format = match format {
Some(fmt) => fmt.to_string(),
None => "%Y-%m-%dT%H:%M:%SZUTC+%z".to_string(),
None => "%Y-%m-%dT%H:%M:%SZ".to_string(),
};
let locale = match locale {

View file

@ -153,7 +153,7 @@ impl<'lua> FromLua<'lua> for DateTimeBuilder {
.with_hour(t.get("hour")?)
.with_minute(t.get("minute")?)
.with_second(t.get("second")?)
.with_millisecond(t.get("millisecond")?)
.with_millisecond(t.get("millisecond").or(LuaResult::Ok(0))?)
.build()),
_ => Err(LuaError::external(
"expected type table for DateTimeBuilder",