Skip to content

Commit

Permalink
FEATURE New DatetimeField class (form field wrapper composed of DateF…
Browse files Browse the repository at this point in the history
…ield andTimeField)

FEATURE New DateField and TimeField form classes with more consistent API and easier localization
API CHANGE Date/time parsing in DateField, TimeField and DatetimeField defaults to i18n::get_locale() ('en_US') instead of using en_NZ/en_GB specific parsing. Use i18n::set_locale('en_NZ') in mysite/_config.php to revert to old behaviour.
API CHANGE  constructor parameter in TimeField needs to be in ISO date notation (not PHP's date())
API CHANGE TimeField, DateField and related subclasses use Zend_Date for date parsing, meaning they're stricer than the previously used strtotime()
API CHANGE Removed DMYCalendarDateField and CalendarDateField, use DateField with setConfig('showcalendar')
API CHANGE Removed CompositeDateField, DMYDateField, use DateField with setConfig('dmyfields')
API CHANGE Removed DropdownTimeField, use TimeField with setConfig('showdropdown')
API CHANGE Removed PopupDateTimeField, use DatetimeField
API CHANGE Changed 'date', 'month' and 'year' HTML field names to lowercase in DMYDateField
API CHANGE Removed support for ambiguous date formats in DateField, e.g. '06/03/03'. Use DateField->setConfig('dateformat', '<format>') to revert to this behaviour.
API CHANGE Removed  flag from DateField, CalendarDateField etc., use DateField->setConfig('min') and DateField->setConfig('max')
ENHANCEMENT Using Zend_Date for DateField and TimeField, with more robust date handling, starting localization support. Set globally via i18n::set_locale(), or for a field instance through setLocale(). Note: Javascript validation is not localized yet. (from r99360)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102859 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
chillu committed Apr 14, 2010
1 parent 76d57b6 commit 6227478
Show file tree
Hide file tree
Showing 20 changed files with 1,120 additions and 675 deletions.
2 changes: 1 addition & 1 deletion core/model/fieldtypes/Datetime.php
Expand Up @@ -58,7 +58,7 @@ function URLDatetime() {
}

public function scaffoldFormField($title = null, $params = null) {
return new PopupDateTimeField($this->name, $title);
return new DatetimeField($this->name, $title);
}

/**
Expand Down
20 changes: 20 additions & 0 deletions css/DateField.css
@@ -0,0 +1,20 @@
.calendardate .calendar table {
width: 200px;
}
.calendardate img {
position: relative;
top: 2px;
cursor: pointer;
}

.calendarpopup {
position: absolute;
left: 0em;
top: 2em;
display: none;
z-index: 2;
}

.calendarpopup.focused {
display: block;
}
File renamed without changes.
File renamed without changes.
62 changes: 0 additions & 62 deletions forms/CalendarDateField.php

This file was deleted.

178 changes: 0 additions & 178 deletions forms/CompositeDateField.php

This file was deleted.

52 changes: 0 additions & 52 deletions forms/DMYCalendarDateField.php

This file was deleted.

0 comments on commit 6227478

Please sign in to comment.