New date/time form field APIs in 2.4

56 views
Skip to first unread message

Ingo Schommer

unread,
Feb 16, 2010, 6:58:51 PM2/16/10
to silverst...@googlegroups.com, devel...@silverstripe.com
Hello there,

I've made some fairly major API changes to branches/2.4 this morning
around date/time fields. This means you will need to review custom
code and any modules you're using (we'll look through
SilverStripe maintained modules very soon, but feel free to file
tickets with your findings).

Overview of the changes:

Basically, instead of the dozen special-case form fields in the old
core, we now have DateField, TimeField, and DatetimeField.
If you want the equivalent of a CalendarDateField, simply
use $myDateField->setConfig('showcalendar').

If you don't want to switch to the new APIs just yet,
I've created a 'legacydatetimefields' module containing the old APIs
(now removed from sapphire core in 2.4):

You should be able to add this as a project external to get the old
behaviour back - let me know if you have any problems with this.

If you're interested, have a look at the background for these changes

Caution: There's a small chance that these APIs will change
again before the beta2 release, particularly around the naming
of setConfig() - I'll keep you posted.

Note: These changes were planned for beta1, but didn't make
it due to time restrictions - having these API changes late in the beta
process should be an exception. Sorry about that!

Thanks
Ingo

-------
Ingo Schommer | Senior Developer
SilverStripe

Skype: chillu23

dalesaurus

unread,
Feb 17, 2010, 1:08:48 PM2/17/10
to SilverStripe Development
How very timely, Ingo! In the other thread today I mentioned the
conversion of datetime values from a SS install/user timezone to the
DB's fixed timezone. With Zend_Date underneath timezone conversions
will be a snap via setTimezone and it internally adjusted GMT date it
always stores. Just need to match it up on a field's write.

Good stuff.

On Feb 16, 5:58 pm, Ingo Schommer <i...@silverstripe.com> wrote:
> Hello there,
>
> I've made some fairly major API changes to branches/2.4 this morning
> around date/time fields. This means you will need to review custom
> code and any modules you're using (we'll look through
> SilverStripe maintained modules very soon, but feel free to file
> tickets with your findings).
>

> Overview of the changes:http://open.silverstripe.org/changeset/99360(thats the important one)http://open.silverstripe.org/changeset/99359http://open.silverstripe.org/changeset/99361http://open.silverstripe.org/changeset/99362http://open.silverstripe.org/changeset/99363


>
> Basically, instead of the dozen special-case form fields in the old
> core, we now have DateField, TimeField, and DatetimeField.
> If you want the equivalent of a CalendarDateField, simply
> use $myDateField->setConfig('showcalendar').
>
> If you don't want to switch to the new APIs just yet,
> I've created a 'legacydatetimefields' module containing the old APIs
> (now removed from sapphire core in 2.4):http://open.silverstripe.org/browser/modules/legacydatetimefields
>
> You should be able to add this as a project external to get the old
> behaviour back - let me know if you have any problems with this.
>
> If you're interested, have a look at the background for these changes

> inhttp://open.silverstripe.org/ticket/5022andhttp://open.silverstripe.org/ticket/4980#comment:4


>
> Caution: There's a small chance that these APIs will change
> again before the beta2 release, particularly around the naming
> of setConfig() - I'll keep you posted.
>
> Note: These changes were planned for beta1, but didn't make
> it due to time restrictions - having these API changes late in the beta
> process should be an exception. Sorry about that!
>
> Thanks
> Ingo
>
> -------
> Ingo Schommer | Senior Developer

> SilverStripehttp://silverstripe.com

Reply all
Reply to author
Forward
0 new messages