Help Desk

Can't change date format by Community Preferences

  • Posts: 32 Topics: 8 Answers: 1
    | Permalink

    Hi everybody, I need to know if I’m doing something wrong about this question: when I change my date format in Community Events Preferences, nothing changes in my frontend. I tried using TwentyEleven and deactivating another plugins but this doesn’t seem to solve, as you can see in this screenshot.
    https://dl.dropboxusercontent.com/u/66658277/Schermata%2007-2456498%20alle%2016.31.57.png
    https://dl.dropboxusercontent.com/u/66658277/Schermata%2007-2456498%20alle%2016.34.16.png

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink
    Correct Answer

    Hi Flavia:

    The setting you are referring to affects the dates in some places, such as the list of events (as found at example.com/community/events/list), but not others (such as the datepicker). The principle reason for this is that the component used to form the datepicker does not understand date formats expressed in the style of a PHP date() string.

    However, one of our team members, Ryan, did suggest that you could add some Javascript along these lines:

    Some notes from Ryan:

    * You may wish to override the submission form template and remove the .datepicker class, replacing it with something unique like .your-custom-class
    * If you do that then please also update the code in the gist appropriately (input.datepicker might become input.your-custom-class)

    So this would require some development know-how to implement but it does seem to be possible – however to be clear this isn’t something the date format field you have referred to is intended to influence.

    Posts: 32 Topics: 8 Answers: 1
    | Permalink

    Great! Could you tell me just where to place this snippet?

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    You could either edit one of your templates and wrap it in <script> tags or – perhaps more “correctly” – you would enqueue it using the WordPress API:

    http://codex.wordpress.org/wp_enqueue_script

    I’m afraid however we can’t really spare much time to talk through that in detail – and the above link probably does a better job of explaining this than I can.

    Definitely though feel free to add a note on our UserVoice page if you feel there is a good case for making the datepicker date formats more flexible via our plugin’s settings page – it would also be interesting from our perspective to see how many others might be in support of this:

    https://tribe.uservoice.com/forums/195723-feature-ideas

    Posts: 65
    | Permalink

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.