Fixed form validation based with different timezones.
This commit is contained in:
parent
e2f824e301
commit
a70377558f
1 changed files with 111 additions and 89 deletions
|
@ -279,8 +279,30 @@ test( "datetime selector check", function() {
|
||||||
el.find('.js-datepicker').trigger('blur')
|
el.find('.js-datepicker').trigger('blur')
|
||||||
|
|
||||||
// check params
|
// check params
|
||||||
|
var timezoneOffset = new Date().getTimezoneOffset()
|
||||||
|
var startHour = 8 + (timezoneOffset/60)
|
||||||
|
if (startHour < 10) {
|
||||||
|
startHour = '0' + startHour.toString()
|
||||||
|
}
|
||||||
currentTime = timeStamp.toISOString()
|
currentTime = timeStamp.toISOString()
|
||||||
currentTime = currentTime.replace(/(\d\d.\d\d.\d\d\.\d\d\dZ)$/, '08:00:00.000Z')
|
currentTime = currentTime.replace(/(\d\d.\d\d.\d\d\.\d\d\dZ)$/, startHour + ':00:00.000Z')
|
||||||
|
params = App.ControllerForm.params(el)
|
||||||
|
test_params = {
|
||||||
|
datetime1: currentTime,
|
||||||
|
}
|
||||||
|
deepEqual(params, test_params, 'params check')
|
||||||
|
|
||||||
|
el.find('.js-timepicker[data-item="time"]').val('9:00')
|
||||||
|
el.find('.js-timepicker[data-item="time"]').trigger('blur')
|
||||||
|
|
||||||
|
// check params
|
||||||
|
var timezoneOffset = new Date().getTimezoneOffset()
|
||||||
|
var startHour = 9 + (timezoneOffset/60)
|
||||||
|
if (startHour < 10) {
|
||||||
|
startHour = '0' + startHour.toString()
|
||||||
|
}
|
||||||
|
currentTime = timeStamp.toISOString()
|
||||||
|
currentTime = currentTime.replace(/(\d\d.\d\d.\d\d\.\d\d\dZ)$/, startHour + ':00:00.000Z')
|
||||||
params = App.ControllerForm.params(el)
|
params = App.ControllerForm.params(el)
|
||||||
test_params = {
|
test_params = {
|
||||||
datetime1: currentTime,
|
datetime1: currentTime,
|
||||||
|
|
Loading…
Reference in a new issue