@jamesrock/rockjs 1.32.0 → 1.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +10 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -675,27 +675,30 @@ export class Time {
675
675
  getMillisecondsInDay(ms) {
676
676
  return (ms % this.day);
677
677
  };
678
+ getMillisecondsInYear(ms) {
679
+ return (ms % this.year);
680
+ };
678
681
  getSecondsInDay(ms) {
679
- return (this.getSeconds(ms) % this.day);
682
+ return this.getSeconds(this.getMillisecondsInDay(ms));
680
683
  };
681
684
  getMinutesInDay(ms) {
682
- return (this.getMinutes(ms) % this.day);
685
+ return this.getMinutes(this.getMillisecondsInDay(ms));
683
686
  };
684
687
  getHoursInDay(ms) {
685
- return (this.getHours(ms) % this.day);
688
+ return this.getHours(this.getMillisecondsInDay(ms));
686
689
  };
687
690
  getDaysInYear(ms) {
688
- return (this.getDays(ms) % this.year);
691
+ return this.getDays(this.getMillisecondsInYear(ms));
689
692
  };
690
693
  getMinutesInHour(ms) {
691
- return floorTo(this.getMillisecondsInHour(ms) / this.minute);
694
+ return this.getMinutes(this.getMillisecondsInHour(ms));
692
695
  };
693
696
  getSecondsInMinute(ms) {
694
- return floorTo(this.getMillisecondsInMinute(ms) / this.second);
697
+ return this.getSeconds(this.getMillisecondsInMinute(ms));
695
698
  };
696
699
  formatSeconds = (ms) => pad(this.getSecondsInMinute(ms));
697
700
  formatMinutes = (ms) => pad(this.getMinutesInHour(ms));
698
- formatHours = (ms) => pad(this.getHours(ms));
701
+ formatHours = (ms) => pad(this.getHoursInDay(ms));
699
702
  format = (ms) => `${this.formatMinutes(ms)}:${this.formatSeconds(ms)}`;
700
703
  };
701
704
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jamesrock/rockjs",
3
- "version": "1.32.0",
3
+ "version": "1.33.0",
4
4
  "description": "utility bliss",
5
5
  "license": "ISC",
6
6
  "author": "James Rock",