Skip to content

Commit fb50143

Browse files
committed
Merge PR uxsolutions#1826 'dates read out are 12am UTC' into 1.6. Closes uxsolutions#1826
2 parents 4cff8c8 + af69691 commit fb50143

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

tests/suites/methods.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,35 +75,35 @@ test('setUTCDate', function(){
7575
});
7676

7777
test('setStartDate', function(){
78-
var date_in = new Date(Date.UTC(2012, 3, 5)),
79-
expected_date = date_in,
78+
var date_in = new Date(2012, 3, 5),
79+
expected_date = new Date(Date.UTC(2012, 3, 5)),
8080
returnedObject = this.dp.setStartDate(date_in);
8181
// ...
8282
datesEqual(this.dp.o.startDate, expected_date);
8383
strictEqual(returnedObject, this.dp, "is chainable");
8484
});
8585

8686
test('setEndDate', function(){
87-
var date_in = new Date(Date.UTC(2012, 3, 5)),
88-
expected_date = date_in,
87+
var date_in = new Date(2012, 3, 5),
88+
expected_date = new Date(Date.UTC(2012, 3, 5)),
8989
returnedObject = this.dp.setEndDate(date_in);
9090
// ...
9191
datesEqual(this.dp.o.endDate, expected_date);
9292
strictEqual(returnedObject, this.dp, "is chainable");
9393
});
9494

9595
test('getStartDate', function(){
96-
var date_in = new Date(Date.UTC(2012, 3, 5)),
97-
expected_date = date_in,
96+
var date_in = new Date(2012, 3, 5),
97+
expected_date = new Date(Date.UTC(2012, 3, 5)),
9898
returnedObject = this.dp.setStartDate(date_in);
9999
// ...
100100
datesEqual(returnedObject.getStartDate(), expected_date);
101101
strictEqual(returnedObject, this.dp, "is chainable");
102102
});
103103

104104
test('getEndDate', function(){
105-
var date_in = new Date(Date.UTC(2012, 3, 5)),
106-
expected_date = date_in,
105+
var date_in = new Date(2012, 3, 5),
106+
expected_date = new Date(Date.UTC(2012, 3, 5)),
107107
returnedObject = this.dp.setEndDate(date_in);
108108
// ...
109109
datesEqual(returnedObject.getEndDate(), expected_date);
@@ -150,21 +150,21 @@ test('moveMonth - can handle invalid date', function(){
150150

151151
test('parseDate - outputs correct value', function(){
152152
var parsedDate = $.fn.datepicker.DPGlobal.parseDate('11/13/2015',$.fn.datepicker.DPGlobal.parseFormat('mm/dd/yyyy'),'en');
153-
equal(parsedDate.getDate(), "13", "date is correct");
154-
equal(parsedDate.getMonth(), "10", "month is correct");
155-
equal(parsedDate.getFullYear(), "2015", "fullyear is correct");
153+
equal(parsedDate.getUTCDate(), "13", "date is correct");
154+
equal(parsedDate.getUTCMonth(), "10", "month is correct");
155+
equal(parsedDate.getUTCFullYear(), "2015", "fullyear is correct");
156156
});
157157

158158
test('parseDate - outputs correct value for yyyy\u5E74mm\u6708dd\u65E5 format', function(){
159159
var parsedDate = $.fn.datepicker.DPGlobal.parseDate('2015\u5E7411\u670813',$.fn.datepicker.DPGlobal.parseFormat('yyyy\u5E74mm\u6708dd\u65E5'),'ja');
160-
equal(parsedDate.getDate(), "13", "date is correct");
161-
equal(parsedDate.getMonth(), "10", "month is correct");
162-
equal(parsedDate.getFullYear(), "2015", "fullyear is correct");
160+
equal(parsedDate.getUTCDate(), "13", "date is correct");
161+
equal(parsedDate.getUTCMonth(), "10", "month is correct");
162+
equal(parsedDate.getUTCFullYear(), "2015", "fullyear is correct");
163163
});
164164

165165
test('parseDate - outputs correct value for dates containing unicodes', function(){
166166
var parsedDate = $.fn.datepicker.DPGlobal.parseDate('\u5341\u4E00\u6708 13 2015',$.fn.datepicker.DPGlobal.parseFormat('MM dd yyyy'),'zh-CN');
167-
equal(parsedDate.getDate(), "13", "date is correct");
168-
equal(parsedDate.getMonth(), "10", "month is correct");
169-
equal(parsedDate.getFullYear(), "2015", "fullyear is correct");
167+
equal(parsedDate.getUTCDate(), "13", "date is correct");
168+
equal(parsedDate.getUTCMonth(), "10", "month is correct");
169+
equal(parsedDate.getUTCFullYear(), "2015", "fullyear is correct");
170170
});

0 commit comments

Comments
 (0)