diff --git a/time.js b/time.js index 5e52f81..ee3a904 100644 --- a/time.js +++ b/time.js @@ -44,19 +44,19 @@ // gets or sets hours this.hours = function(newHours) { - if (!newHours) return hours; + if (newHours === undefined) return hours; hours = parseInt(newHours, 10); }; // gets or sets minutes this.minutes = function(newMinutes) { - if (!newMinutes) return minutes; + if (newMinutes === undefined) return minutes; minutes = parseInt(newMinutes, 10); }; // gets or sets period this.period = function(newPeriod) { - if (!newPeriod) return period; + if (newPeriod === undefined) return period; period = parsePeriod(newPeriod); }; } @@ -90,6 +90,76 @@ return d; }; + /* Returns time hours in 24 range + * + * Parameters + * ---------- + * time