Skip to content

Commit 4b865d1

Browse files
committed
- (Refactor) Added new FlipClock.Time.getDateObject method to always return a date object, even when the time is an integer
1 parent 7070565 commit 4b865d1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/flipclock/js/libs/time.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@
5858
this.time = time;
5959
}
6060
},
61+
62+
getDateObject: function() {
63+
if(this.time instanceof Date) {
64+
return this.time;
65+
}
66+
67+
return new Date(this.getTimeSeconds());
68+
},
6169

6270
/**
6371
* Convert a string or integer to an array of digits

0 commit comments

Comments
 (0)