PEEL Shopping
Open source ecommerce : PEEL Shopping
modifier.date_format.php
Go to the documentation of this file.
1 <?php
29 function smarty_modifier_date_format($string, $format=null, $default_date='', $formatter='auto')
30 {
31  if ($format === null) {
32  $format = Smarty::$_DATE_FORMAT;
33  }
37  require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
38  if ($string != '' && $string != '0000-00-00' && $string != '0000-00-00 00:00:00') {
39  $timestamp = smarty_make_timestamp($string);
40  } elseif ($default_date != '') {
41  $timestamp = smarty_make_timestamp($default_date);
42  } else {
43  return;
44  }
45  if($formatter=='strftime'||($formatter=='auto'&&strpos($format,'%')!==false)) {
46  if (DS == '\\') {
47  $_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T');
48  $_win_to = array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S');
49  if (strpos($format, '%e') !== false) {
50  $_win_from[] = '%e';
51  $_win_to[] = sprintf('%\' 2d', date('j', $timestamp));
52  }
53  if (strpos($format, '%l') !== false) {
54  $_win_from[] = '%l';
55  $_win_to[] = sprintf('%\' 2d', date('h', $timestamp));
56  }
57  $format = str_replace($_win_from, $_win_to, $format);
58  }
59  return strftime($format, $timestamp);
60  } else {
61  return date($format, $timestamp);
62  }
63 }
64 
65 ?>
static $_DATE_FORMAT
The date format to be used internally (accepts date() and strftime())
smarty_make_timestamp($string)
Function: smarty_make_timestamp Purpose: used by other smarty functions to make a timestamp from a s...
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
Definition: chart-data.php:160
smarty_modifier_date_format($string, $format=null, $default_date='', $formatter='auto')
Smarty date_format modifier plugin.

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:16 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.