Hi,
Could someone please give me the right syntax for creating a date field through a pattern ? - well, actually, I succeeded in it but the granularity is not correctly set : I just need the year, month and day ; when created, the field has "year,month,day,hour,minute" granularity (which is default settings I believe). I tried :
<granularity>
<year>year</year>
<month>month</month>
<day>day</day>
</granularity>
... this ... :
<granularity>
<year>1</year>
<month>1</month>
<day>1</day>
<hour>0</hour>
<minutes>0</minutes>
</granularity>
... this .. :
<granularity>
year,month,day
</granularity>
... and so on ! now I don't know what to try and I'm quite desperate !!
Need help, please !
Thank you !
Comments
Comment #1
vaish commentedDefault behaviour for all places where multiple checkboxes or multiple select list are used is that default or previous values are preserved and values from the pattern are just merged with them. If you want to make sure that previous (or default) values are cleared and only values specified in your pattern are applied you need to use "overwrite" attribute. Here is an example that produces desired result:
Most of the times this kind of default behaviour is desired and expected but in this particular case it's unfortunately quite counterintuitive.
Comment #2
iko commentedHi,
Thanks for the answer but, I'm afraid, there's something wrong. Here is the code for my date field :
Every "patternized" setting is correctly customised, but the granularity still remains as default.
Thanks,
Comment #3
vaish commentedHi iko,
Your pattern did work for me. I tested with the latest dev version of patterns, CCK 6.x-2.6 and date 6.x-2.4. Could you please make sure your modules are up to date and try once again.
Thanks.
Comment #4
iko commentedoh, yes, you're right ! one of the modules involved in the process was probably outdated.
thank you !