Custom datepicker locale

Contains tips for configurators working with Aware IM
Post Reply
hpl123
Posts: 2594
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Custom datepicker locale

Post by hpl123 »

Hi all,
Here is a tip on how to use override the datepicker locale (E.g. "M" for Monday etc.). This fix only fix the locale in the datepicker used in forms, on calendar top bar etc..
The "standard" locale for e.g. calendar, forms etc. still needs to be done in the Aware IM locale.

1. Create file "datepicker.js" in folder "C:\AwareIM\Tomcat\webapps\AwareIM\aware_ext".

2. Add the following to the datepicker.js where the daynames are your custom daynames starting with "Sunday":
Ext.override(Ext.DatePicker, {
dayNames: [
'Söndag',
'Måndag',
'Tisdag',
'Onsdag',
'Torsdag',
'Fredag',
'Lördag'
],
});

3. Add the following AFTER the theme you are using in file "themes.props" in folder "C:\AwareIM\bin\" (this can be added to all themes I guess i.e. you can add it to the "Blue" theme if you want to or you can create your own theme (MyTheme) and add it to the "MyTheme" theme. Here is an example using "MyTheme":
ThemeMyTheme=MyTheme;ext-4.1.0/resources/css/ext-all.css;aware_ext/datepicker.js

4. Restart AwareIM server.

5. Reload your browser / log in to your application and now when your theme is loaded so is your custom datepicker daynames for that theme.
Henrik (V8 Developer Ed. - Windows)
Rennur
Posts: 1191
Joined: Thu Mar 01, 2012 5:13 am
Location: Sydney, Australia

Post by Rennur »

Thanks for the tip. I love the separate 'overwrite'' .js idea.

Do you know if Ext.override can override all/any of the ExtJS classes?

Cheers
hpl123
Posts: 2594
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Overrides

Post by hpl123 »

Yeah, the override option is nice. I THINK it can be used for other extjs classes etc. but i´m not sure. The override option/fix is a part of the core extjs framework (for custom fixing of bugs, temporary extending of functionality etc.) but there might be other custom things Awaresoft has done that limits it´s use. Support can maybe comment on this?
Henrik (V8 Developer Ed. - Windows)
hpl123
Posts: 2594
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Custom datepicker locale

Post by hpl123 »

The datepicker locale bug has been fixed in 6.0 so now when a locale is set, the datepicker uses the daynames correctly.
Henrik (V8 Developer Ed. - Windows)
Post Reply