Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1689 from dwaltz/master
Browse files Browse the repository at this point in the history
Unit tests for variation of timezone value input
  • Loading branch information
swilliamset committed Jan 26, 2016
2 parents 928c70f + b2e6064 commit 58eee56
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/scheduler-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,34 @@ define(function(require){
// }
});

test('timezone set properly under acceptable variation of value input', function () {
var schedule = {
startDateTime: '2016-03-31T03:23-07:00'
};

var $scheduler = $('<div>'+templateHtml+'</div>').find('#MyScheduler').scheduler();

$scheduler.scheduler('value', schedule);
equal($scheduler.scheduler('value').timeZone.name, 'US Mountain Standard Time', 'timezone parameter not provided but UTC time given with appropriate offset');

schedule = {
startDateTime: '2016-03-31T24:23+07:00',
timeZone: {
offset: '+07:00'
}
};
$scheduler.scheduler('value', schedule);
equal($scheduler.scheduler('value').timeZone.name, 'SE Asia Standard Time', 'timezone parameter provided along side UTC timezone');

schedule = {
timeZone: {
offset: '-07:00'
}
};
$scheduler.scheduler('value', schedule);
equal($scheduler.scheduler('value').timeZone.name, 'US Mountain Standard Time', 'timezone is the only parameter provided');
});

test('should set/get recurrence pattern properly', function() {
var schedule = {
startDateTime: '2014-03-31T03:23+02:00',
Expand Down

0 comments on commit 58eee56

Please sign in to comment.