mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Datepicker: Fix localization demo
This commit is contained in:
parent
fd3a68cfa3
commit
40e8519437
@ -16,12 +16,15 @@
|
||||
<link rel="stylesheet" href="../demos.css">
|
||||
<script>
|
||||
$(function() {
|
||||
var calendar = $( "#calendar" ).calendar(),
|
||||
date = calendar.calendar( "valueAsDate" );
|
||||
var calendar = $( "#calendar" ),
|
||||
select = $( "#locale" );
|
||||
|
||||
$( "#locale" ).change( function() {
|
||||
Globalize.locale( select.val() );
|
||||
calendar.calendar();
|
||||
|
||||
select.change( function() {
|
||||
Globalize.locale( $( this ).val() );
|
||||
calendar.calendar( "valueAsDate", date );
|
||||
calendar.calendar( "valueAsDate", calendar.calendar( "valueAsDate" ) );
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
@ -17,11 +17,15 @@
|
||||
<link rel="stylesheet" href="../demos.css">
|
||||
<script>
|
||||
$(function() {
|
||||
Globalize.locale( "de-DE" );
|
||||
$( "#datepicker" ).datepicker();
|
||||
$( "#locale" ).change(function() {
|
||||
// TODO refresh the current value to convert to the selected locale
|
||||
var datepicker = $( "#datepicker" ),
|
||||
select = $( "#locale" );
|
||||
|
||||
Globalize.locale( select.val() );
|
||||
datepicker.datepicker();
|
||||
|
||||
select.change( function() {
|
||||
Globalize.locale( $( this ).val() );
|
||||
datepicker.datepicker( "valueAsDate", datepicker.datepicker( "valueAsDate" ) );
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user