Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to modify Date format in Calendar's DateChooser

    I am using SmartGWT 3.1.
    I can not change the format of the DateChooser in the Calendar Widget.
    The application I am working on is in French and the date display for June and July are the same : "Jui, 7 2013"
    I need to change the format to display "7 Juillet 2013" in the header of the calendar.

    I have tried to use DateUtil.setShortDatetimeDisplayFormatter
    but the displayed does not change.

    #2
    Hello,

    you can set the short names in SmartGwt 4.1 with DateUtil.setShortMonthNames(). The length of the short names is fixed to 3, I think. So I change Juillet to Jul.
    Code:
                String[] shortMonthNames = { "Jan", "F\u00e9v", "Mar", "Avr", "Mai", "Jui", "Jul", "Ao\u00fb", "Sep", "Oct", "Nov", "D\u00e9c" };
                DateUtil.setShortMonthNames(shortMonthNames);
    In Version 3.1 you have to create you own setShortMonthNames like:
    Code:
        public static native void setShortMonthNames(String[] shortMonthNames) /*-{
    		var shortMonthNamesJS = @com.smartgwt.client.util.JSOHelper::convertToJavaScriptArray([Ljava/lang/Object;)(shortMonthNames);
    			$wnd.isc.addProperties($wnd.Date, {
    				shortMonthNames : shortMonthNamesJS
    			});
        }-*/;
    Regards

    Peter

    Comment

    Working...
    X