DD-MM-YYYY date format to create invoices


#1

Hi,
In v1.5.9, discovered an issue when choosing the DD-MMM-YYYY date format (like 05-Sep-2018). When creating a quote and trying to get the invoice from this quote, picking the invoice date is adding a “.” between month and year (it becomes 05-Sep.-2018) and then the proceed button doesn’t work.
Romain


#2

I have tried to reproduce that behaviour in the IP-demo sire and I haven’t found any problem.

Could you try it yourself in IP-demo just to make sure that the same steps are done? This way we will find whether this is an issue with IP or with your installation.


#3

I tried with the demo and indeed it does not happen. The demo is v1.5.0 ? My version is 1.5.9, does it make a difference ?
Here the snapshot of the issue
issue_date


#4

The demo also runs version 1.5.9, the title is not correct, sorry.


#5

OK, no problem. Maybe it comes from a language specific issue (French --> KO, but other languages --> OK) ?


#6

Have you made any modifications to IP? I think IP uses a php date formating function that does not use the language setting.


#7

I did not modify IP. Can it be the 1000 or decimal separator ?


#8

When you click on the date field to enter a date and the calendar opens, in which language language is it? in English or in French? For instance, does it say “today” or “aujourd’hui”? “September” or “Septembre”?

If it is on English, the problem is elsewhere, but if it appears on French, please, open the Firefox debugger,

Screenshot-1

then scroll down until you find this piece of code

Screenshot-2

and copy&paste it here or take a screenshot and post it.


#9

@grizzly there’s no need to run the debugger, just confirm that the calendar is in French (I am almost sure it does).

Yesterday I found the cause of your problem when investigating another language problem in IP. I will see later if there is an easy fix, otherwise I will send you a temporary solution.


#10

@miquel_cabanas yes the calendar is in French


#11

This change seems to solve the problem. In the file ‘application/modules/quotes/views/modal_quote_to_invoice.php’ comment out the line number 14

invoice_date_created: $('#invoice_date_created').val(),

and below it insert the line,

invoice_date_created: $('#invoice_date_created').datepicker("option", "dateFormat", "dd-mm-yy").val(),

to obtain

// invoice_date_created: $('#invoice_date_created').val(),
invoice_date_created: $('#invoice_date_created').datepicker("option", "dateFormat", "dd-mm-yy").val(),

Try it and let us know if it works in which case I will submit the fix for v1.5.10.


#12

I have created an issue for this bug:

  • IP-734 - Datepicker returns in certain cases a date with a format not compatible with MySQL

#13

Really not a cool issue. If I set a format for the datepicker it should not change it based on the locale. Let’s see if this can be fixed.


#14

Bizarre, pas de souci pour moi
Bizarre, no problem for me

IP 1.5.9 on Chrome 70

image


#15

Please try with DD-MM-YYYY date format. I’ve no issue either with DD/MM/YYYY date format


#16

Let me summarize the current state of this issue:

  • The bug has been confirmed and we are working to fix it asap.
  • The cause is that IP1 was originally designed as a single-user English-user application, and it uses internally the PHP date-conversion function createFromFormat() that is not language-aware and crashes when it is handled certain non-English date strings.

Workaround: Until this bug gets fixed, the only workaround is to avoid data formats that cause problems, like DD-MM-YYYY in French.

How to find out if you are affected: If the Submitt-button stops responding in any of the pop-up (modal) windows like “Create Invoice”, “Enter Payment”, etc.