����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 216.73.216.156 Web Server : Apache/2.4.41 (Ubuntu) System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/admin/assets/plugins/bootstrap-datepicker/tests/suites/ |
Upload File : |
module('Events', { setup: function(){ this.input = $('<input type="text" value="31-03-2011">') .appendTo('#qunit-fixture') .datepicker({format: "dd-mm-yyyy"}) .focus(); // Activate for visibility checks this.dp = this.input.data('datepicker') this.picker = this.dp.picker; }, teardown: function(){ this.picker.remove(); } }); test('Selecting a year from decade view triggers changeYear', function(){ var target, triggered = 0; this.input.on('changeYear', function(){ triggered++; }); equal(this.dp.viewMode, 0); target = this.picker.find('.datepicker-days thead th.datepicker-switch'); ok(target.is(':visible'), 'View switcher is visible'); target.click(); ok(this.picker.find('.datepicker-months').is(':visible'), 'Month picker is visible'); equal(this.dp.viewMode, 1); // Not modified when switching modes datesEqual(this.dp.viewDate, UTCDate(2011, 2, 31)); datesEqual(this.dp.date, UTCDate(2011, 2, 31)); target = this.picker.find('.datepicker-months thead th.datepicker-switch'); ok(target.is(':visible'), 'View switcher is visible'); target.click(); ok(this.picker.find('.datepicker-years').is(':visible'), 'Year picker is visible'); equal(this.dp.viewMode, 2); // Not modified when switching modes datesEqual(this.dp.viewDate, UTCDate(2011, 2, 31)); datesEqual(this.dp.date, UTCDate(2011, 2, 31)); // Change years to test internal state changes target = this.picker.find('.datepicker-years tbody span:contains(2010)'); target.click(); equal(this.dp.viewMode, 1); // Only viewDate modified datesEqual(this.dp.viewDate, UTCDate(2010, 2, 1)); datesEqual(this.dp.date, UTCDate(2011, 2, 31)); equal(triggered, 1); }); test('Navigating forward/backward from month view triggers changeYear', function(){ var target, triggered = 0; this.input.on('changeYear', function(){ triggered++; }); equal(this.dp.viewMode, 0); target = this.picker.find('.datepicker-days thead th.datepicker-switch'); ok(target.is(':visible'), 'View switcher is visible'); target.click(); ok(this.picker.find('.datepicker-months').is(':visible'), 'Month picker is visible'); equal(this.dp.viewMode, 1); target = this.picker.find('.datepicker-months thead th.prev'); ok(target.is(':visible'), 'Prev switcher is visible'); target.click(); ok(this.picker.find('.datepicker-months').is(':visible'), 'Month picker is visible'); equal(triggered, 1); target = this.picker.find('.datepicker-months thead th.next'); ok(target.is(':visible'), 'Next switcher is visible'); target.click(); ok(this.picker.find('.datepicker-months').is(':visible'), 'Month picker is visible'); equal(triggered, 2); }); test('Selecting a month from year view triggers changeMonth', function(){ var target, triggered = 0; this.input.on('changeMonth', function(){ triggered++; }); equal(this.dp.viewMode, 0); target = this.picker.find('.datepicker-days thead th.datepicker-switch'); ok(target.is(':visible'), 'View switcher is visible'); target.click(); ok(this.picker.find('.datepicker-months').is(':visible'), 'Month picker is visible'); equal(this.dp.viewMode, 1); // Not modified when switching modes datesEqual(this.dp.viewDate, UTCDate(2011, 2, 31)); datesEqual(this.dp.date, UTCDate(2011, 2, 31)); target = this.picker.find('.datepicker-months tbody span:contains(Apr)'); target.click(); equal(this.dp.viewMode, 0); // Only viewDate modified datesEqual(this.dp.viewDate, UTCDate(2011, 3, 1)); datesEqual(this.dp.date, UTCDate(2011, 2, 31)); equal(triggered, 1); }); test('Navigating forward/backward from month view triggers changeMonth', function(){ var target, triggered = 0; this.input.on('changeMonth', function(){ triggered++; }); equal(this.dp.viewMode, 0); target = this.picker.find('.datepicker-days thead th.prev'); ok(target.is(':visible'), 'Prev switcher is visible'); target.click(); ok(this.picker.find('.datepicker-days').is(':visible'), 'Day picker is visible'); equal(triggered, 1); target = this.picker.find('.datepicker-days thead th.next'); ok(target.is(':visible'), 'Next switcher is visible'); target.click(); ok(this.picker.find('.datepicker-days').is(':visible'), 'Day picker is visible'); equal(triggered, 2); }); test('format() returns a formatted date string', function(){ var target, error, out; this.input.on('changeDate', function(e){ try{ out = e.format(); } catch(e){ error = e; } }); equal(this.dp.viewMode, 0); target = this.picker.find('.datepicker-days tbody td:nth(15)'); target.click(); datesEqual(this.dp.viewDate, UTCDate(2011, 2, 14)); datesEqual(this.dp.date, UTCDate(2011, 2, 14)); equal(error, undefined) equal(out, '14-03-2011'); }); test('format(altformat) returns a formatted date string', function(){ var target, error, out; this.input.on('changeDate', function(e){ try{ out = e.format('m/d/yy'); } catch(e){ error = e; } }); equal(this.dp.viewMode, 0); target = this.picker.find('.datepicker-days tbody td:nth(15)'); target.click(); datesEqual(this.dp.viewDate, UTCDate(2011, 2, 14)); datesEqual(this.dp.date, UTCDate(2011, 2, 14)); equal(error, undefined) equal(out, '3/14/11'); }); test('Clear button: triggers change and changeDate events', function(){ this.input = $('<input type="text" value="31-03-2011">') .appendTo('#qunit-fixture') .datepicker({ format: "dd-mm-yyyy", clearBtn: true }) .focus(); // Activate for visibility checks this.dp = this.input.data('datepicker'); this.picker = this.dp.picker; var target, triggered_change = 0, triggered_changeDate = 0; this.input.on({ changeDate: function(){ triggered_changeDate++; }, change: function(){ triggered_change++; } }); this.input.focus(); ok(this.picker.find('.datepicker-days').is(':visible'), 'Days view visible'); ok(this.picker.find('.datepicker-days tfoot .clear').is(':visible'), 'Clear button visible'); target = this.picker.find('.datepicker-days tfoot .clear'); target.click(); equal(triggered_change, 1); equal(triggered_changeDate, 1); });