Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

CalendarDateField implemented in 2.4RC1?


Go to End


11 Posts   5828 Views

Avatar
SreckoM

Community Member, 4 Posts

27 April 2010 at 1:06am

hi,

I installed 2.4RC1 on my server, but when I tried to use CalendarDateField I got this when try to access page in admin:

'Fatal error: Class 'CalendarDateField' not found in /home/webwm/public_html/mysite/code/Test.php on line 19'.

Same code works OK in 2.3.

Any tips?

Avatar
SreckoM

Community Member, 4 Posts

27 April 2010 at 3:19am

OK, solved.

You need legacydatetimefields installed to be able to use this field...

Avatar
ttyl

Community Member, 114 Posts

28 April 2010 at 6:36am

had the same problem - however, rather than installing support for legacydatetimefields is there a new preferred method? surely this functionality hasn't been removed?

Avatar
Trent

Community Member, 2 Posts

28 April 2010 at 8:03am

I would recommend using the DatePickerField that is available from The DataObject_Manager Module found here:

http://www.silverstripe.org/dataobjectmanager-module/

Usage for DatePickerField
http://doc.silverstripe.com/datepickerfield

Usage of the Data Object Manager
http://doc.silverstripe.org/modules:DataObjectManager

Avatar
Willr

Forum Moderator, 5523 Posts

28 April 2010 at 9:25pm

timtim - to answer your question I think you can invoke the calendar by setting the 'showcalendar' var.

$field = new DateField(....);
$field->setConfig('showcalendar', true);

Avatar
ttyl

Community Member, 114 Posts

30 April 2010 at 4:30am

DatePickerField works like a charm

Avatar
ttyl

Community Member, 114 Posts

30 April 2010 at 8:33am

actually, I spoke too soon. when using either method I get a validation error ("Please enter a valid time format.") - is this a 2.4 bug?

Avatar
Xeal

Community Member, 37 Posts

7 May 2010 at 2:42am

Hmm this needs to be fixed as when you choose a date from the Calendar it will give me this for
May 06, 2010 : 06/05/2010
but when I save it this becomes
Jun 5, 2010. This will become a major problem as soon as a date gets bigger than 12. I'd submit a ticket if I could and knew how but hopefully someone takes care of this. I've recently upgraded my sites to 2.4 and these small bugs although not a major issue are annoying.

Go to Top