diff --git a/src/auth/serializer/src/types.js b/src/auth/serializer/src/types.js index f76bcea0..81a8ecc9 100644 --- a/src/auth/serializer/src/types.js +++ b/src/auth/serializer/src/types.js @@ -405,8 +405,8 @@ Types.time_point_sec = { if(typeof object !== "string") throw new Error("Unknown date type: " + object) - // if(typeof object === "string" && !/Z$/.test(object)) - // object = object + "Z" + if(typeof object === "string" && !/Z$/.test(object)) + object = object + "Z" return Math.floor( new Date(object).getTime() / 1000 ); }, diff --git a/test/all_types.js b/test/all_types.js index 965f6c4e..3a69caea 100644 --- a/test/all_types.js +++ b/test/all_types.js @@ -34,6 +34,7 @@ let AllTypes = new Serilizer("all_types", { time_optional: optional( time_point_sec ), time_point_sec1: time_point_sec, time_point_sec2: time_point_sec, + time_point_sec3: time_point_sec, }) // Must stay in sync with AllTypes above. @@ -59,6 +60,7 @@ let allTypes = { time_optional: undefined, time_point_sec1: new Date(), time_point_sec2: Math.floor(Date.now()/1000), + time_point_sec3: '2017-02-16T20:27:12', } describe("all types", ()=> {