-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExample_es.html
53 lines (46 loc) · 1.94 KB
/
Example_es.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>jQuery Locale</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js" type="text/javascript"></script>
<script src="src/jquery.locale.js" type="text/javascript"></script>
<script src="src/jquery.ui.datepicker-es.js" type="text/javascript"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/themes/base/jquery-ui.css" type="text/css" media="all" />
<script>
$(function() {
$('#test').locale({
callback: function(flag) {
var region = flag["region"];
if(region == 'en') {
$.datepicker.setDefaults($.datepicker.regional[""]);
$('#iCal').datepicker($.datepicker.regional[""]);
} else {
$.datepicker.setDefaults($.datepicker.regional[flag.region]);
$('#iCal').datepicker($.datepicker.regional[flag.region]);
}
},
'flags': [{
'name': 'United States',
'code': 'us',
'region': 'en'
}, {
'name': 'Mexico',
'code': 'mx',
'region': 'es'
}]
});
$.datepicker.setDefaults($.datepicker.regional[""]);
$("#iCal").datepicker();
});
</script>
</head>
<body>
<h3>U.S. and Mexico only</h3>
<p>This example changes the date picker locale on the change event<p><br/>
<div id="test"></div><br/>
<input id="iCal" type="text" style="width:100px;"/>
</body>
</html>