Skip to content

Commit

Permalink
MSPB-251: fix parseTime function (#423)
Browse files Browse the repository at this point in the history
* MSPB-251: fix parseTime function

* use moment on parseTime function

Co-authored-by: Joris Tirado <[email protected]>
  • Loading branch information
mavriciomart and joristirado authored Jun 21, 2022
1 parent 50d40df commit 7108526
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions submodules/strategyHours/strategyHours.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ define(function(require) {
var monster = require('monster'),
_ = require('lodash'),
$ = require('jquery'),
moment = require('moment'),
Papa = require('papaparse'),
timezone = require('monster-timezone');

Expand Down Expand Up @@ -170,10 +171,9 @@ define(function(require) {
_.toLower
),
parseTime = function(time) {
return time <= 24 ? time * meta.unit : time;
return moment.duration(time).asSeconds();
},
sanitizeTime = _.flow(
_.toNumber,
parseTime,
_.floor
),
Expand Down

0 comments on commit 7108526

Please sign in to comment.