Setting a UK date
  • joelukjoeluk May 2010

    Hi Chaps,

    I would like to configure the date format to UK (day/month/year), however i can't see anyway of changing this. Is there a way to configure this within simpleinvoices or should I be looking else where.

    Thanks in advance,

    Joel

  • I wanted to do the same thing, but there are lots of places where the date has been hardcoded to YYYY-MM-DD and also in the Javascript validations. So I thought to leave it like that, too many changes to consider :)

  • justinjustin May 2010

    hey guys

    all input date must be in YYYY-MM-DD , this is just to keep things simple

    all output dates are based on localisation settings in the config.ini file
    - refer http://simpleinvoices.org/config#localization

    does this help?

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • joelukjoeluk May 2010

    Hi Justin,

    Our config.ini localisation setting is set to en-gb however the date still shows in the US format. Within the invoice template I've used $invoice.date variable, is this right?

    Many thanks

    Joel
    www.nippygecko.com

  • Hi

    If you are trying this in the tpl file then you may try something like - $invoices.date|siLocal_date
    If you are doing this within php file then you may try something like - siLocal::date($invoice.date)

  • sumiteksumitek May 2010

    try in phpmyadmin in the database.

    si_system_defaults

    standard dateformate is Y-m-d

    change dateformate to d-m-Y

    :)

  • justinjustin May 2010

    hey joel

    can you post an example of the US date in question
    - its just theres alot of different place and type of dates in Simple Invoices

    and try what harvinder mentions - that should fix it up

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • Hi

    We were thinking of changing the date style as well, but there are a lot of places within simple invoices where this date style - YYYY-MM-DD is hardcoded i.e. javascript validations, when writing to database etc.

    So we decided to just use this style over all instead, although it does look a little odd but if it becomes too much inconvenience we may have to do the changes on all the places. I wouldn't waste much time on changing the date structure on all the parts in Simple Invoices because no matter what there will be new requirements for the date format for different people. It is a little hard to put something in place in the config file for the date format because of the javascript validation on date fields and so on.

    I guess if anything needs to be done we might just have a generic date format variable in the config file say DD-MM-YYYY and everywhere else this format gets used, but it is easier said then done.

    Thanks
    Harvinder Singh

  • don_camillodon_camillo October 2010

    I changed the ini file the country localization.
    But the in the date section in SI, it shows the name of the month not the number of the month.

    Such as 01.Jan.2010 but i want to see it like 01.01.2010
    How to change it?

  • SiboSibo January 3

    Hi don_camillo,

    Smarty can set the date format for you, try to use it in your templates.
    For example: {$invoice.date|date_format:"%e %B %Y"}
    The only problem is that the localization is not set right for smarty!!

    What I did is to add this line to your translate localization directory (lang/nl_NL/lang.php)
    setlocale(LC_ALL, 'nl_NL');

    Smarty use not the localization what is set in the config.ini file. BUG?
    The date will by now for my email template's '2 januari 2012'.
    Strangely enough it will not work for my invoice templates...

    http://www.smarty.net/docsv2/en/language.modifier.date.format

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

Categories