Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

More Time / Date formats in configuration.php
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #1  
Old 01-15-2007, 08:28 AM
 
burtsTechie burtsTechie is offline
 

Member
  
Join Date: Sep 2006
Posts: 20
 

Default More Time / Date formats in configuration.php

I wanted to change the time / date format, but didn't like the choices available on the x-cart admin. I'm a fan of a full month (e.g. January vs Jan) and no leading 0 in time (e.g. 8:12pm vs 08:12pm). I didn't want to find each instance of the date/time in the .tpl files, so I figured I'd make the change on the configuration side. I did some poking around the smarty website and found these changes that I could make to configuration.php (~line 167 in 4.13)

In configuration.php, after
PHP Code:
if ($option == "Appearance") {
    
$date_formats = array( 

Add: "%B %e, %Y" to the list. This gives the date format January 15, 2007 as an option found in general settings/appearance in the admin side.

After:
PHP Code:
$time_formats = array( 

Add: "%l:%M %p" to the list. This gives the time format 8:15pm as an option.

Here's my complete code for that section:

PHP Code:
if ($option == "Appearance") {
    
$date_formats = array(
        
"%d-%m-%Y",
        
"%d/%m/%Y",
        
"%d.%m.%Y",
        
"%m-%d-%Y",
        
"%m/%d/%Y",
        
"%Y-%m-%d",
        
"%b %e, %Y",
        
"%A, %B %e, %Y",
        
"%B %e, %Y");
    
$time_formats = array(
        
"",
        
"%H:%M:%S",
        
"%H.%M.%S",
        
"%I:%M:%S %p",
        
"%l:%M %p"); 

I hope that helps someone else that wants a more streamlined appearance for dates/times on their order invoices and other places!
__________________
X-Cart Version: 4.15 (in development)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:38 PM.

   

 
X-Cart forums © 2001-2018