From 36458e50ec10b26650d3abb3e7b0b1636747b77b Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Wed, 4 Oct 2017 13:51:23 -0600 Subject: [PATCH] Fixed ISectionRunJSON duration --- common/sprinklers/json/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/sprinklers/json/index.ts b/common/sprinklers/json/index.ts index 636fdd5..8112524 100644 --- a/common/sprinklers/json/index.ts +++ b/common/sprinklers/json/index.ts @@ -106,11 +106,15 @@ export interface ISectionRunJSON { const sectionRunProps = ["id", "section", "duration", "startTime", "pauseTime"]; export function sectionRunToJSON(sectionRun: s.SectionRun): ISectionRunJSON { - return pick(sectionRun, sectionRunProps); + return { + ...pick(sectionRun, sectionRunProps), + duration: sectionRun.duration.toSeconds(), + }; } export function sectionRunFromJSON(sectionRun: s.SectionRun, json: ISectionRunJSON) { assign(sectionRun, pick(json, sectionRunProps)); + sectionRun.duration = s.Duration.fromSeconds(json.duration); } interface ISectionRunnerJSON {