Hi! Your module is fantastic and very easy to use!
Just one question: the date format is mm/dd/YYYY but i'd like to use the format dd/mm/YYYY everywhere, specially in the notification for the final user when he put a valid coupon but non in the valid period.

Comments

millionleaves’s picture

Agreed - surely this should follow the regional settings for the site?

The code to handle this is in coupon_commerce_date.module:

  $date_format = 'D, m/d/Y';  
  $error_msg_prefix = t('Unfortunately, this coupon is only valid ');  
  $lower_pass_msg = t('starting %start', array('%start' => format_date($start, 'custom', $date_format)));  
  $upper_pass_msg = t('until %end', array('%end' => format_date($end, 'custom', $date_format)));

This modified code would be better for a wide range of uses:

  $error_msg_prefix = t('Unfortunately, this coupon is only valid ');  
  $lower_pass_msg = t('starting %start', array('%start' => format_date($start, 'short')));  
  $upper_pass_msg = t('until %end', array('%end' => format_date($end, 'short')));

This will use the standard Short date format in your Date and Time settings for the site. You could then customise this date format if you want. For example, the Short date default format includes the time, which doesn't look great IMHO (but might be exactly what you want).

Even better would be either providing the option for the administrator to choose which date format to use, or creating a new 'Coupon' date format during installation that can be customised without affecting the default Short date format which may be in use elsewhere on the site.

millionleaves’s picture

Component: Documentation » User interface
Category: Support request » Feature request