Showing with 31 additions and 31 deletions.
  1. +2 −2 demos/datepicker/alt-field.html
  2. +16 −15 demos/datepicker/icon-trigger.html
  3. +2 −2 external/date.js
  4. +7 −7 tests/unit/date/date_core.js
  5. +4 −5 ui/datepicker.js
@@ -18,8 +18,8 @@
$(function() {
$( "#datepicker" ).datepicker({
select: function( event, ui ) {
var date = Globalize.parseDate( ui.date );
$( "#alternate" ).val( Globalize.format( date, "dddd, d MMMM, yyyy" ) );
var date = Globalize.parseDate( ui.date, { date: "short" } );
$( "#alternate" ).val( Globalize.format( date, { date: "long" } ) );
}
});
});
@@ -16,21 +16,22 @@
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
var allowOpen = false;
var datepicker = $( "#datepicker" ).datepicker({
beforeOpen: function() {
return allowOpen;
}
});
$( "<img src='images/calendar.gif' alt='Open Datepicker'>")
.insertAfter( datepicker )
.click(function() {
allowOpen = true;
datepicker.focus();
setTimeout(function() {
allowOpen = false;
});
});
var allowOpen = false,
datepicker = $( "#datepicker" ).datepicker({
beforeOpen: function() {
return allowOpen;
},
open: function() {
allowOpen = false;
}
});

$( "<img src='images/calendar.gif' alt='Open Datepicker'>")
.insertAfter( datepicker )
.click( function() {
allowOpen = true;
datepicker.focus();
});
});
</script>
</head>
@@ -125,8 +125,8 @@ $.date.prototype = {
for ( var dow = 0; dow < 7; dow++ ) {
var day = ( dow + weekdaysRev[ Globalize.locale().supplemental.weekData.firstDay() ] ) % 7;
result.push({
shortname: Globalize.locale().main([ "dates/calendars/gregorian/days/format/abbreviated", weekdays[ day ] ]),
fullname: Globalize.locale().main([ "dates/calendars/gregorian/days/format/wide", weekdays[ day ] ]),
shortname: Globalize.locale().main([ "dates/calendars/gregorian/days/format/short", weekdays[ day ] ]),
fullname: Globalize.locale().main([ "dates/calendars/gregorian/days/format/wide", weekdays[ day ] ])
});
}
return result;
@@ -64,13 +64,13 @@ test( "Date Adjustments - Leap Year Edge Cases", 1, function() {
test( "List days of Week", 2, function() {
var date = $.date(),
offset0 = [
{ "fullname": "Sunday", "shortname": "Sun" },
{ "fullname": "Monday", "shortname": "Mon" },
{ "fullname": "Tuesday", "shortname": "Tue" },
{ "fullname": "Wednesday", "shortname": "Wed" },
{ "fullname": "Thursday", "shortname": "Thu" },
{ "fullname": "Friday", "shortname": "Fri" },
{ "fullname": "Saturday", "shortname": "Sat" }
{ "fullname": "Sunday", "shortname": "Su" },
{ "fullname": "Monday", "shortname": "Mo" },
{ "fullname": "Tuesday", "shortname": "Tu" },
{ "fullname": "Wednesday", "shortname": "We" },
{ "fullname": "Thursday", "shortname": "Th" },
{ "fullname": "Friday", "shortname": "Fr" },
{ "fullname": "Saturday", "shortname": "Sa" }
],
offset1 = [
{ "fullname": "Montag", "shortname": "Mo." },
@@ -34,7 +34,7 @@ var idIncrement = 0,
return $.widget( "ui.datepicker", {
options: {
appendTo: null,
dateFormat: null,
dateFormat: { date: "short" },
// TODO review
eachDay: $.noop,
numberOfMonths: 1,
@@ -54,7 +54,6 @@ return $.widget( "ui.datepicker", {
},

_create: function() {
this.options.dateFormat = this.options.dateFormat || { date: "short" };
this.date = $.date( null, this.options.dateFormat );

this.date.eachDay = this.options.eachDay;
@@ -79,7 +78,7 @@ return $.widget( "ui.datepicker", {
},
"click .ui-datepicker-current": function( event ) {
event.preventDefault();
this.select( event, new Date().getTime() );
this._select( event, new Date().getTime() );
},
"click .ui-datepicker-close": function( event ) {
event.preventDefault();
@@ -89,7 +88,7 @@ return $.widget( "ui.datepicker", {
event.preventDefault();
// TODO exclude clicks on lead days or handle them correctly
// TODO store/read more then just date, also required for multi month picker
this.select( event, $( event.currentTarget ).data( "timestamp" ) );
this._select( event, $( event.currentTarget ).data( "timestamp" ) );
if ( this.inline ) {
this.grid.focus( 1 );
}
@@ -656,7 +655,7 @@ return $.widget( "ui.datepicker", {
}, this.options.position );
},

select: function( event, time ) {
_select: function( event, time ) {
this.date.setTime( time ).select();
this.refresh();
if ( !this.inline ) {