XF 2.1 How to change order of month and year in Pikaday title

Aivaras

Well-known member
It'd be great if the ordering of the year and month values in the title of Pikaday followed the locale settings. I need the year to precede the month like so:
1577117814356.webp

instead of the default:
1577117830971.webp

I don't see an HTML template in ACP (XF2) allowing me to achieve this. Do you know of a way to re-order month and year in the title of Pikaday?
 
Hi, after a long search I have found something that might help you.

After searching the whole XenForo directory for the phrase "pika-single" I found that (almost?) the entire Pikaday is created in a single JS file. This explains why you can't find any Templates for it, neither public nor admin.

If you navigate to js\vendor\pikaday\pikaday.js you'll find the following:
On line 391 the Month select label is created.
On Line 406 the Year select label is created.

I am not going to fiddle with them around but swapping them (and making a few adjustments) should do the trick.

Have fun.


Now if only someone could help me with my Styling & Customization Question thread 🤔
 
Yes, I'm aware of the method you've suggested. The problem with editing files directly is one has to re-edit them every time XF is updated as the files get overwritten with the new ones.

Ideally XF should look in ACP > Appearance > Languages > Edit language > Date format and adjust the order of year and month in Pikaday accordingly. May be I should make a suggestion?
 
Then why didn't you say that? It would have saved me quite some time -.-

Anyway, seeing how some of the other JS code looks like it should be possible to use the time format variable.
I just doubt that it is important enough because it's purely cosmetic.

What's worse in my opinion is that you enter yyyy-mm-dd in the input field instead of dd-mm-yyyy (like Germans are used to).
 
Top Bottom