kitchen-cli
kitchen-cli copied to clipboard
Small issue in form_util.js secondsToTime function
When using a valid time "s" is numeric which causes "s.toUpperCase()" to throw an exception resulting in the time field not being set.
this.secondsToTime = function(seconds, timeFormat) {
var s = seconds || 0;
var tf = timeFormat || "h:mm a";
if(s.toUpperCase() == "NOW") {
return moment(new Date()).format(tf);
}
return moment.unix(s).utc().format(tf);
};
Should be:
this.secondsToTime = function(seconds, timeFormat) {
var s = seconds || 0;
var tf = timeFormat || "h:mm a";
if(String(s).toUpperCase() === "NOW") {
return moment(new Date()).format(tf);
}
return moment.unix(s).utc().format(tf);
};
@lyftsoftware thank you! Fixed and will be available in next version (0.9.58)