Skip to content

Commit 66385d4

Browse files
committed
Calendar: Fix demos after widget split
1 parent c63073f commit 66385d4

7 files changed

Lines changed: 24 additions & 30 deletions

File tree

demos/calendar/buttonbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</head>
2525
<body>
2626

27-
<p>Date: <input type="text" id="calendar"></p>
27+
<div id="calendar"></div>
2828

2929
<div class="demo-description">
3030
<p>Display a button for selecting Today's date and a Done button for closing the calendar with the boolean <code>showButtonPanel</code> option. Each button is enabled by default when the bar is displayed, but can be turned off with additional options. Button text is customizable.</p>

demos/calendar/date-formats.html

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,17 @@
1616
<link rel="stylesheet" href="../demos.css">
1717
<script>
1818
$(function() {
19-
$( "#calendar" ).calendar();
19+
var calendar = $( "#calendar" ).calendar(),
20+
value;
21+
2022
$( "#format" ).change(function() {
21-
var format;
22-
switch( $( this ).val() ) {
23-
case "short":
24-
$( "#calendar" ).calendar( "option", "dateFormat", {
25-
date: "short"
26-
});
27-
break;
28-
case "long":
29-
$( "#calendar" ).calendar( "option", "dateFormat", {
30-
date: "long"
31-
});
32-
break;
23+
value = $( this ).val();
24+
switch( value ) {
3325
case "iso":
34-
$( "#calendar" ).calendar( "option", "dateFormat", {
35-
pattern: "yyyy-MM-dd"
36-
});
26+
calendar.calendar( "option", "dateFormat", { pattern: "yyyy-MM-dd" } );
27+
break;
28+
default:
29+
calendar.calendar( "option", "dateFormat", { date: value } );
3730
break;
3831
}
3932
});
@@ -42,7 +35,7 @@
4235
</head>
4336
<body>
4437

45-
<p>Date: <input type="text" id="calendar" size="30"/></p>
38+
<div id="calendar"></div>
4639

4740
<p>Format options:<br />
4841
<select id="format">

demos/calendar/dropdown-month-year.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</head>
2626
<body>
2727

28-
<p>Date: <input type="text" id="calendar"></p>
28+
<div id="calendar"></div>
2929

3030
<div class="demo-description">
3131
<p>Show month and year dropdowns in place of the static month/year header to facilitate navigation through large timeframes. Add the boolean <code>changeMonth</code> and <code>changeYear</code> options.</p>

demos/calendar/localization.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,23 @@
1616
<link rel="stylesheet" href="../demos.css">
1717
<script>
1818
$(function() {
19-
Globalize.locale( "de-DE" );
20-
$( "#calendar" ).calendar();
19+
var calendar = $( "#calendar" ).calendar(),
20+
date = calendar.calendar( "valueAsDate" );
21+
2122
$( "#locale" ).change(function() {
22-
// TODO refresh the current value to convert to the selected locale
2323
Globalize.locale( $(this).val() );
24+
calendar.calendar( "valueAsDate", date );
2425
});
2526
});
2627
</script>
2728
</head>
2829
<body>
2930

30-
<p>Date: <input type="text" id="calendar"/>&nbsp;
31-
<select id="locale">
32-
<option value="de-DE" selected>German (Deutsch)</option>
33-
<option value="en">English</option>
34-
</select></p>
31+
<div id="calendar"></div>
32+
<select id="locale">
33+
<option value="de-DE" selected>German (Deutsch)</option>
34+
<option value="en">English</option>
35+
</select></p>
3536

3637
<div class="demo-description">
3738
<p>Localize the calendar calendar language and format (English / Western formatting is the default). The calendar includes built-in support for languages that read right-to-left, such as Arabic and Hebrew.</p>

demos/calendar/multiple-month.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</head>
2626
<body>
2727

28-
<p>Date: <input type="text" id="calendar"></p>
28+
<div id="calendar"></div>
2929

3030
<div class="demo-description">
3131
<p>Set the <code>numberOfMonths</code> option to an integer of 2 or more to show multiple months in a single calendar.</p>

demos/calendar/other-months.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</head>
3131
<body>
3232

33-
<p>Date: <input type="text" id="calendar"></p>
33+
<div id="calendar"></div>
3434

3535
<div class="demo-description">
3636
<p>The calendar can show dates that come from other than the main month

demos/calendar/show-week.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</head>
2525
<body>
2626

27-
<p>Date: <input type="text" id="calendar"></p>
27+
<div id="calendar"></div>
2828

2929
<div class="demo-description">
3030
<p>The calendar can show the week of the year. The calculation follows

0 commit comments

Comments
 (0)