updated date pathauto addressfield honeypot features modules

This commit is contained in:
Bachir Soussi Chiadmi
2015-10-12 12:03:12 +02:00
parent 0ba0c21bb9
commit eb699f528d
109 changed files with 5363 additions and 2372 deletions

View File

@@ -15,8 +15,14 @@ function date_devel_generate($entity, $field, $instance, $bundle) {
$entity_field = array();
if (isset($instance['widget']['settings']['year_range'])) {
$split = explode(':', $instance['widget']['settings']['year_range']);
$back = str_replace('-', '', $split[0]);
$forward = str_replace('+', '', $split[1]);
// Determine how much to go back and forward depending on whether a relative
// number of years (with - or + sign) or an absolute year is given.
$back = strpos($split[0], '-') === 0
? str_replace('-', '', $split[0])
: date_format(date_now(), 'Y') - $split[0];
$forward = strpos($split[1], '+') === 0
? str_replace('+', '', $split[1])
: $split[1] - date_format(date_now(), 'Y');
}
else {
$back = 2;
@@ -61,9 +67,11 @@ function date_devel_generate($entity, $field, $instance, $bundle) {
case 'date':
$format = DATE_FORMAT_ISO;
break;
case 'datestamp':
$format = DATE_FORMAT_UNIX;
break;
case 'datetime':
$format = DATE_FORMAT_DATETIME;
break;