Hi Bram,
sorry for the late reply.
The reason why you got that error is because each item in "formats"
is supposed to be an array with various keys, one of which can be
"format", so the correct code would have been:
<parameter name="formats">
<parameter>
<parameter name="format">dd/MM/yyyy</parameter>
</parameter>
</parameter>
However, this is now possible (in SVN, didn't make it into RC7). See
http://trac.agavi.org/ticket/596 for details. In your case, it can be
even simpler - just <parameter name="formats">dd/MM/yyyy</parameter>
since you have just one format rule for all locales.
Cheers,
David
P.S: you had two syntax errors in your parameters, did you notice?
<parameters>, and the missing closing quotation marks.
Am 09.10.2007 um 10:42 schrieb Goessens, Bram:
> Hey,
>
> I'm currently experiencing some difficulties in my agavi 11 version,
> trying to validate a date in a textfield. In my textfield I enter a
> date
> in following format: dd/MM/yyyy (fe 09/10/2007).
>
>
> My xml validation code:
>
> <validator class="datetime" name="wrong_dateformat"
> required="false">
> <argument>datum_p<argument>
> <error>wrong date format</error>
> <parameters name="formats>
> <parameter name="format">dd/MM/yyyy</parameter>
> </parameters>
> </validator>
>
>
>
> When I validate this field I get the following exception:
>
> ---
> at exception origin
> in core.agavi_dir/translation/AgaviLocale.class.php
> line 977
>
> 974.
>
> 975. $localeData['locale_str'] =
> substr($identifier, 0, strcspn($identifier, '@'));
>
> 976. } else {
>
> 977.
> throw new AgaviException('Invalid locale identifier (' .
> $identifier . ') specified');
>
> 978. }
>
> 979.
>
> 980. return $localeData;
> ---
>
>
> Anyone got any idea what causes the exception above?
>
> Thanks in advance!
>
> Bram
>
>
>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.agavi.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users