-
Notifications
You must be signed in to change notification settings - Fork 538
Added the getTime method #40
base: gh-pages
Are you sure you want to change the base?
Conversation
- Allow to add a Date as the 'default' options
Lekker bezig Moosje! |
|
||
// Minutes can have AM/PM that needs to be removed | ||
this.hours = + value[0] || 0; | ||
this.minutes = + (value[1] + '').replace(/\D/g, '') || 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the first +
be there? What does it do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Casts it to a number
It's good addition. Where Can I get version with it? It's no in official repo. |
@piernik Thanks! It is not in the official repo yet, @weareoutman needs to approve it first :) |
|
||
if (this.twelvehour) { | ||
var period = (value[1] + '').replace(/\d+/g, '').toLowerCase(); | ||
this.amOrPm = this.hours < 12 || period === 'am' ? 'AM' : 'PM'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
12:00AM and 12:00PM both get converted to 12:00PM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattkrick You are right fixed the issue in this commit
JordyMoos@6f0ac5f
Is the project still supported? I'm asking because I think this pull is quite important and it's been opened in Dec 4, 2014 but I can't see any feedback from the maintainers about the possibility of a merge. |
Added the getTime method which returns a Date object, the hours and minutes will be added to today.
Also allows you to add a Date object as the 'default' options.
It will only use the Date object to get the time. It will not update the Date object when the time changes