CJe
CJe

Reputation: 1992

Get datepicker to return specific time of day

ExtJS 4.2.2

I have this datefield with the format

d-m-Y H:i:s

I would like the datepicker to return the selected date with a specific time - 07:00 (7AM). So that if I pick today it would return

17-09-2014 07:00:00

and not as it does now

17-09-2014 00:00:00

I've tried to find a configuration but it's just not obvious to me if there is one...

Please help

Upvotes: 0

Views: 65

Answers (1)

CJe
CJe

Reputation: 1992

Handled it using the 'select' event:

select: function(field, value, eOpts){
    field.setValue(new Date(value.setHours(7,0,0)))
}

Upvotes: 1

Related Questions