Home › Forums › Calendar Products › Events Calendar PRO › Yet another date formatting question
- This topic has 5 replies, 2 voices, and was last updated 12 years ago by
Barry.
-
AuthorPosts
-
April 3, 2014 at 6:46 am #127375
suncoastpca
ParticipantHello,
I think I’ve been through just about every thread I can find, and I’m aware that the plugin takes its date formatting settings from WP’s Admin settings, but there are 2 places where I would like to change the format:
1. In calendar month view, in the Tribe Bar, there’s an “Events In” field that always displays Y-m. I’d love to be able to change this to m-Y.
2. In the admin UI when adding or editing an event, the Start Date & Time and End Date & Time fields are always Y-m-d.
Any suggestions?
–PaulApril 3, 2014 at 3:28 pm #127764Barry
MemberHmm, well the first is probably easier to change than the second – however both I would say are, at this time, advanced customizations. We’re certainly open to feature requests for inclusion in future releases, though, if you’d like to post one 🙂
April 3, 2014 at 4:11 pm #127805suncoastpca
ParticipantThanks, Barry.
Advanced customizations? That’s OK, I’m an advanced user. 🙂 I’ll post the feature request, but can you maybe point me in the right direction? I don’t need detailed instructions – I just had trouble tracking down where in the code these things are implemented. (I’m sure I’ll figure it out eventually, but I’m just hoping to save some time).
April 4, 2014 at 2:14 pm #128275Barry
MemberSure. Well with regards to the datepicker in the Tribe Bar first of all, the format is defined using the following piece of code which lives in resources/tribe-events-bar.js around lines 77-80, or thereabouts (of course normally the minified version of that code is used):
td.datepicker_opts = { format: 'yyyy-mm-dd', autoclose: true };We don’t recommend editing core code and so, ideally, you’d need to override this by some other means. In the admin UI you would need to look for something similar in events-admin.js. Besides the Javascript, you’d probably want to make some changes at PHP level – for example to format the date correctly when the page initially loads and for the front end you’ll probably be interested in setting up a filter using the tribe-events-bar-date-search-default-value hook.
Good luck!
April 4, 2014 at 2:41 pm #128289suncoastpca
ParticipantPerfect! Exactly what I was looking for. I hope to have some time to mess with this over the weekend. Thanks very much for the help.
April 17, 2014 at 7:02 am #135024Barry
MemberHappy to help 🙂
-
AuthorPosts
- The topic ‘Yet another date formatting question’ is closed to new replies.
