Projet

Général

Profil

Révision b720ea3e

Ajouté par Assos Assos il y a plus de 8 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/date/date.devel_generate.inc
15 15
  $entity_field = array();
16 16
  if (isset($instance['widget']['settings']['year_range'])) {
17 17
    $split = explode(':', $instance['widget']['settings']['year_range']);
18
    $back = str_replace('-', '', $split[0]);
19
    $forward = str_replace('+', '', $split[1]);
18
    // Determine how much to go back and forward depending on whether a relative
19
    // number of years (with - or + sign) or an absolute year is given.
20
    $back = strpos($split[0], '-') === 0
21
      ? str_replace('-', '', $split[0])
22
      : date_format(date_now(), 'Y') - $split[0];
23
    $forward = strpos($split[1], '+') === 0
24
      ? str_replace('+', '', $split[1])
25
      : $split[1] - date_format(date_now(), 'Y');
20 26
  }
21 27
  else {
22 28
    $back = 2;
......
61 67
    case 'date':
62 68
      $format = DATE_FORMAT_ISO;
63 69
      break;
70

  
64 71
    case 'datestamp':
65 72
      $format = DATE_FORMAT_UNIX;
66 73
      break;
74

  
67 75
    case 'datetime':
68 76
      $format = DATE_FORMAT_DATETIME;
69 77
      break;

Formats disponibles : Unified diff