mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-05-24 00:24:07 +03:00
Merge commit 'd21ea7816e
' as 'jquery-ui'
This commit is contained in:
commit
e904a80717
629 changed files with 341074 additions and 0 deletions
27
jquery-ui/tests/unit/datepicker/datepicker_test_helpers.js
vendored
Normal file
27
jquery-ui/tests/unit/datepicker/datepicker_test_helpers.js
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
TestHelpers.datepicker = {
|
||||
addMonths: function(date, offset) {
|
||||
var maxDay = 32 - new Date(date.getFullYear(), date.getMonth() + offset, 32).getDate();
|
||||
date.setDate(Math.min(date.getDate(), maxDay));
|
||||
date.setMonth(date.getMonth() + offset);
|
||||
return date;
|
||||
},
|
||||
equalsDate: function(d1, d2, message) {
|
||||
if (!d1 || !d2) {
|
||||
ok(false, message + " - missing date");
|
||||
return;
|
||||
}
|
||||
d1 = new Date(d1.getFullYear(), d1.getMonth(), d1.getDate());
|
||||
d2 = new Date(d2.getFullYear(), d2.getMonth(), d2.getDate());
|
||||
equal(d1.toString(), d2.toString(), message);
|
||||
},
|
||||
init: function( id, options ) {
|
||||
$.datepicker.setDefaults( $.datepicker.regional[ "" ] );
|
||||
return $( id ).datepicker( $.extend( { showAnim: "" }, options || {} ) );
|
||||
},
|
||||
initNewInput: function( options ) {
|
||||
var id = $( "<input>" ).appendTo( "#qunit-fixture" );
|
||||
return TestHelpers.datepicker.init( id, options );
|
||||
},
|
||||
onFocus: TestHelpers.onFocus,
|
||||
PROP_NAME: "datepicker"
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue