Date format

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1279
    ExpertGeeks
    Participant

    Hi,
    I’ve noticed that the date is MM/DD/YYYY. Everything I can think of is set to en_GB (and so should be DD/MM/YYY). How can I fix this ? Thanks.

    #1280
    RRowley
    Participant

    I’ve standardized the date format displayed on screens to the database format, yyyy-mm-dd. The value on the invoice, expense and payment view screens had been missed. The most recent update, Version: 2020.0.11, corrects this.

    If you want a difference format for the printed invoice, you’ll need to develop a custom template.

    #1288
    ExpertGeeks
    Participant

    I’ve downloaded the zip from github, but it seems to be a revision off;

    Version: 2020.0.10 — 20201217

    This is still showing the date in MM-DD-YYYY format. How/where would I need to edit this to make changes to the date format ? My template references this field using;

    {$invoice.date|utilDate}

    • This reply was modified 3 years, 2 months ago by ExpertGeeks.
    #1290
    ExpertGeeks
    Participant

    I also tried a git clone and copying across the usual config files etc etc and I get;

    PdoDb – construct error: SQLSTATE[HY000] [1698] Access denied for user ‘root’@’localhost’ (Error code: 0)

    #1291
    ExpertGeeks
    Participant

    I’ve manually made the changes listed here;

    https://github.com/fearless359/simpleinvoices/commit/62c86040ae3cc154aa3e76bc51d1f8fd25f16155

    to my working copy of 2020.0.10 which should bring me up to v2020.0.11. Despite all dates now showing as YYYY-MM-DD in the menus, they’re still MM-DD-YYYY in the print preview and the PDF’s for both the default template and my own eg-invoice template.

    • This reply was modified 3 years, 2 months ago by ExpertGeeks.
    #1293
    ExpertGeeks
    Participant

    Apologies, I think the version issue might have been to a permission on the config folder. I’ve tried the update again and now it shows 2020.0.11, however the print preview and the pdfs still have the date formate of MM-DD-YYYY. I’d be very happy with your new format of YYYY-MM-DD, I think this format makes the most sense. If only I could get the PDF’s to comply !

    #1294
    RRowley
    Participant

    PDF’s are an exception to the rule. They contain their own code to display values and any changes you want to make require you to implement a customized version. Check out the directions for the Invoice Templates & Styles menu link to the left.

    #1295
    ExpertGeeks
    Participant

    The default template (which the “Invoices Templates & Styles” you referenced to edit) renders the date in MM-DD-YYYY format.

    I can’t put this any more plainly, how can I get the default template to display the date in the format YYYY-MM-DD ?

    #1296
    RRowley
    Participant

    You need to make a custom template. The instructions I mentioned tell you how to initially set this up. You can copy the default directory to a new directory named for example, “mypdf”, and then modify line 35 of the template.tpl file and change {$invoice.date|utilDate} to {$invoice.date|htmlSafe}.

    #1328
    ExpertGeeks
    Participant

    Thanks Richard. Can I recommend you amended this in the default template? Cheers.

    #1577
    nayakweb
    Participant

    Hi, can someone let me know how to change the date format to dd-mmm-yyyy and the locale to en_IN?

    #1578
    RRowley
    Participant

    Let’s start with the locale. Currently there is no en_IN locale defined. But you can remedy that quite simply. In the lang directory, make an “en_IN” directory. Then copy into it the info.xml and lang.php file from whichever language directory most closely matches what you want. If that is the en_US directory, then in the copied lang.php file, delete the lines at the end following the $LANG[‘zip’]… line (the ones in the if statement for setting the user password help format).

    Modify the information in the copied, info.xml file.

    At this point you now have an “en_IN” locale set up. Of course the words in the lang.php file have not been translated. You can do that as necessary. Once you have your lang.php file set up, you can send me copies of both the xml and php file via an attached zip file containing them, via this forum. I’ll add them to the standard application for future users, etc.

    With these files set up, there are two places where you set en_IN to use it in field formatting and language selection. First is in the config/custom.config.ini file “localLocale” setting. The next is in the Settings/Inv Prefs tabs records, set both the Language and Locale fields to en_IN.

    As for the date. In the screens that display the date, the format is as it comes from the database. “yyyy-mm-dd” I believe. This is standard and yields a natural sorting order for the field if you order the management tables by it.

    For the invoice templates, you get whatever they display. You can modify them and make your own invoice formatting for dates and other information however you please; but it isn’t necessarily controlled by the locale settings.

    Hope this helps.

    • This reply was modified 2 years, 7 months ago by RRowley.
Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.