Add time input to contribution form #146
@@ -21,7 +21,7 @@ export default Component.extend({
|
||||
|
||||
|
|
||||
init () {
|
||||
this._super(...arguments);
|
||||
this.set('defaultDate', new Date()); // TODO use beginning of current hour
|
||||
this.set('defaultDate', moment().startOf('hour').toDate());
|
||||
|
||||
// Default attributes used by reset
|
||||
this.set('attributes', {
|
||||
|
||||
Reference in New Issue
Block a user
Someone has an idea for how to do this in the most simple and efficient way? /cc @galfert @fsmanuel
I think it works like this:
Unfortunately you can't just concatenate it (
new Date().setHours(0, 0, 0, 0)), becausesetHoursreturns a timestamp.Scrap my previous comment, I misread you wanted it to be the beginning of the day, not the current hour.
Since we already have moment in the project, I think the easiest way would be
Awesome, will try that. Thanks!