EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
September 14, 2025, 01:07:00 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
Datebox + Calendar
Pages: [
1
]
« previous
next »
Print
Author
Topic: Datebox + Calendar (Read 13632 times)
lusabo
Newbie
Posts: 8
Datebox + Calendar
«
on:
March 13, 2012, 07:14:13 AM »
Hi All,
I have a datebox field and I'd like to change the months name on calendar that appears with datebox. How to do it?
$(".campoData").datebox({
currentText: "Hoje",
closeText: "Fechar",
formatter: function(date){
var y = date.getFullYear();
var m = date.getMonth() + 1;
var d = date.getDate();
return (d<10?('0'+d):d)+'/'+(m<10?('0'+m):m)+'/'+y;
},
parser: function(s){
if (!s) return new Date();
var ss = s.split('/');
var d = parseInt(ss[0],10);
var m = parseInt(ss[1],10);
var y = parseInt(ss[2],10);
if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
return new Date(y,m-1,d);
} else {
return new Date();
}
}
});
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: Datebox + Calendar
«
Reply #1 on:
March 13, 2012, 06:51:02 PM »
The datebox is created based on calendar and the month names is defined in calendar.
The easiest way to change the month names is to override the calendar default property:
$.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...