Open ricardo-lewis opened 6 years ago
@ricardo-lewis System configuration - Interface & Features - Date format It is necessary to consider the configuration.
@64j that's all good and well however it does not help the fact that MTV can only offer sorting via traditional less than < and greater than > etc etc even for date fields.
So when an MTV date value is stored in the database right now, it is stored in the format that the above multitv.js file specifies, which is d/m/y.
This means that we cannot use sorting and filtering on a date field. In order to achieve that I had to alter the core JS file in the manner I described above.
Even if the JS file were to use the System Config, it would still be completely unable to sort and filter unless the config was set to y/m/d.
The alternative is to update MTV to use true MySQL date sorting functions, or to convert and store the dates as UNIX timestamps. But then the timestamps would need to be converted back to d/m/y again in the Manager.
@ricardo-lewis Use the appropriate repository https://github.com/extras-evolution/multiTV
@64j Did I post this in the wrong repository? Or are you asking me to do a pull request?
@ricardo-lewis Yes, I ask you to transfer your wishes to the appropriate branch.
@64j Which is the appropriate branch?
@ricardo-lewis https://github.com/extras-evolution/multiTV/tree/2.0.14
or Master
@64j Are you sure what you doing? This link leads to the same repository where this issue is created
@mnoskov Точно... ветку не посмотрел))
@ricardo-lewis I apologize. You wrote everything correctly
@mnoskov
Look, I almost said something but I think what @64j is trying to say is "please submit this as a pull request"
I'll admit I was being lazy since I thought it would be way way way way quicker for the actual developer to change 2 lines of code than it would be for me to make a clean fork of the repo, commit my change, and then submit the pull request with all the requirements met.
But here we are 7 hours later.
It is not only to replace 2 lines of code but also to ensure backward compatibility with previous versions. If you just change these lines, after update, all previous dates wil lbe lost.
Can we please change the datepicker format from MMDDYY to YYMMDD?
This will allow sorting and filtering via >=, <= etc
https://github.com/extras-evolution/multiTV/blob/866cfd19bf241a88b1443f9cc9232b0bfb668278/assets/tvs/multitv/js/multitv.js#L259
https://github.com/extras-evolution/multiTV/blob/866cfd19bf241a88b1443f9cc9232b0bfb668278/assets/tvs/multitv/js/multitv.js#L988
Proposed change: