[Logo] Mentawai Forum - Mentawai Web Framework
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 

Forum Read-Only! Check the new site and forum here!

mtw:inputDate Calendar shows wrong locale  XML
Forum Index -> General Comments
Author Message
sarat adiraj



Joined: 27/11/2009 02:11:24
Messages: 3
Offline

Hi, I'm a newbie and have recently built a project based on mentawai.I have noticed that the inputDate tag shows the calendar popup in a different locale.How do I fix this? Let me know if you need more info.
Thanks
IceW0lf


[Avatar]

Joined: 16/03/2006 08:33:38
Messages: 1546
Location: Brasília
Offline

Sarat,

Use this temporary solution, I'll be implementing this solution for the future inputDate.

In your action / application / filters / whatever use this:
Code:
 Locale locale = new Locale("YOUR_LOCALE");
 SimpleDateFormat myPattern = new SimpleDateFormat("dd/MM/yyyy", locale);
 
 //Set a variable whatever in your output
 output.setValue("myStringFormatDate", myPattern.toPattern());
 



On JSP use like this.
Code:
 <c:set var="myFormatDate"><mtw:i18n key="myStringFormatDate"/></c:set>
 <mtw:inputDate name="myDate" id="myDate" size="10" textAlign="right" dateFormat="${myFormatDate}"/>
 

Leiber Wallace
Voixy ::: Soluções em Telecomunicações
Lobo


[Avatar]

Joined: 23/01/2006 02:17:14
Messages: 840
Location: Fortaleza-CE
Offline

hi sarat adiraj,

checkout the code from svn
http://www.mentaframework.org/code.jsp

now the inputDateConfig has a new attribute "lang"
the languages supported are en, br and es

Code:
 <mtw:inputDateConfig lang="br" />
 <mtw:inputDateConfig lang="en" />
 <mtw:inputDateConfig lang="es" />
 



Atenciosamente,
Hélio Frota

Helio Frota
10+ Java Programmer
heliofrota.com

Member
Mentawai Developer
sarat adiraj



Joined: 27/11/2009 02:11:24
Messages: 3
Offline

Thanks guys, the locale support is working. Metawai rocks !!
johnylon



Joined: 14/12/2011 05:41:41
Messages: 1
Offline

sarat adiraj wrote:
Hi, I'm a newbie and have recently built a project based on mentawai.I have noticed that the inputDate tag shows the calendar popup in a different locale.How do I fix this? Let me know if you need more info.
Thanks 



This might be done by just changing your inputDate tag to the location you want to set.
[WWW]
lolyny



Joined: 28/12/2011 01:56:18
Messages: 1
Offline

You may try after changing your input data to the exact location where you want to set it.
Attempt this first and if you have any problem after this then you can contact me here.
[WWW]
 
Forum Index -> General Comments
Go to:   
Powered by JForum 2.1.6 © JForum Team