I set up a Template Variable [*workEndYear*] type: number, widget: date formatter, date format: %Y where I wish to store only the year of the date, but this gives me strange output.
Exhamples:
editing page -> viewing page
1998 -> 1998
2004 -> 2010
note: going back to edit mode the value seems kept correct.
what’s wrong?
thank you
MODx evo 1.5~1.6 ✪ Apache v 2.2.22 ✪ PHP v 5.3.10 ✪ MySQL v 5.1.61
<°'iiii);
-
☆ A M B ☆
- 2,475 Posts
I don’t think you can use the number type here... I think you need the "date" data type.
I see, but how can I use year only (prefereably both imput and output)?
Thanks
MODx evo 1.5~1.6 ✪ Apache v 2.2.22 ✪ PHP v 5.3.10 ✪ MySQL v 5.1.61
<°'iiii);
if you need a number for year only you can make a dropdown-tv for example with input-option-values:
@EVAL for ($year=2000;$year<2050;$year++){$output[]=$year;} return $output;