PDA

View Full Version : Internation Date format d/m/Y



mrrezayam
26 Oct 2012, 8:54 AM
I am using Ext3.4.0.

I have the following code:

var birthSearchField = new Ext.form.DateField({
id: 'birthDate',
fieldLabel: 'Birthdate',
name: 'birthDate',
format: 'd/m/Y',
emptyText:roster. 'dd/mm/yyyy',
allowBlank:false
});

I use the format for international date 'd/m/Y'.

If the user enters 5/2/87, the date box shows 02/05/1987 which is wrong. It should show 05/02/1987.
If the user enters 05/02/1987, the date box shows 05/02/1987.

I do not want to force user to enter dd/mm/yyyy.

This is working OK with american date format 'm/d/Y'.

How Can I solve this problem?

Thank you for your help is advance.

Reza

mitchellsimoens
29 Oct 2012, 7:24 AM
So you use format 'd/m/Y' and if you enter 5/2/87 it should return 02/05/1987 as 5 is the day, 2 is the month and 87 is the year according to your format.

mrrezayam
29 Oct 2012, 8:30 AM
I use format 'd/m/Y' and I enter 5/2/87 it should return 05/02/1987 as 5 is the day, 2 is the month and 87 is the year according to my format. But it returns 02/05/1987 which means 2 is the day and 5 is the month.

Thank You

ns.nagu.ngl
10 Dec 2012, 2:22 AM
edit the altFormats