Forums

Date Format problem

elliottbe 26 Jul, 2008
Hi, I saw in another Answer how the date Format dd-mm-yyyy was solved. As Intelligent as I am (???) I combined, that the same way also a format check for dd.mm.yyyy would work and put in the following code: var regex = /^(\d{2})[\-\/\.](\d{2})[\-\/\.](\d{4})$/;

However, this seems not to work ;-(
Do you see a reason for?

To give you something back in advace, here the German translation for the error Codes:

'required', 'Dieses Feld darf nicht leer sein.'
'validate-number', 'Bitte eine Zahl in diesem Feld eingeben.'
'validate-digits', 'Bitte nur Zahlen eingeben, keine Leerschlaege oder andere Zeichen wie Komma,Punkt etc.'
'validate-alpha', 'Bitte nur Buchstaben (a-z) eingeben.'
'validate-alphanum', 'Bitte nur Buchstaben (a-z) oder Zahlen (0-9) eingeben. Keine Leerschlaege oder Sonderzeichen.'
'validate-date', 'Bitte ein gueltiges Datum eingeben.'
'validate-email', 'Bitte eine gueltige EMail Adresse wie [email]fred@domain.com[/email] eingeben.'
'validate-url', 'Bitte eine gueltige URL eingeben.'
'validate-date-au', 'Bitte Datum im Format tt.mm.jjjj eingeben. Bsp. 17.03.2006 für den 17. Maerz 2006'
'validate-currency-dollar', 'Bitte einen Betrag eingeben. Bsp. $100.00 .'
'validate-selection', 'Bitte auswaehlen'
'validate-one-required', 'Bitte eine Auswahl treffen.'

Thanks for your help.
Max_admin 26 Jul, 2008
Hi elliottbe,

What was the regex used for : dd-mm-yyyy ? let me see the one which solved it!

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
elliottbe 26 Jul, 2008
Hi Max,
thanks for your reply. the regex I found in the Board was written by Greyhead
var regex = /^(\d{2})[\-\/](\d{2})[\-\/](\d{4})$/;
Unfortunately I can't find the original post quickly ;-(
Regards,
elliottbe
elliottbe 26 Jul, 2008
Hi Again,
meanwhile I found the Post!
How to realy translate chronoforms
by pjdevries on Mon Feb 11, 2008 10:44 pm
Max_admin 27 Jul, 2008
I'm not sure since this needs testing but the most logical to me is to try this :

var regex = /^(\d{2})[\.\/](\d{2})[\.\/](\d{4})$/;

??

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
elliottbe 27 Jul, 2008
Hi Max,
playing around with the string, I found, that it is only working, if the \. is at the first position in the definition. so the currently working string is:
var regex = /^(\d{2})[\.\-\/](\d{2})[\.\-\/](\d{4})$/;

Thanks for your excellent support and the very good product!
Greets, Elliottbe
Max_admin 27 Jul, 2008
Glad it works now, thanks Elliottbe!!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.