• Resolved solidaritelocale

    (@solidaritelocale)


    Hi wiredimpact,

    Thank you for this great plugin, it’s exactly what I was looking for!

    I have a few issue using it, I’ll post them in different topics so each title can be relevant.

    First issue :
    My WordPress is configured in French, and so is the date/time format.
    – When I use the drop-down calendar to set the date of a one-time opportunity, the selected date/time goes to the text area, but when I save it just vanished.
    – If I enter the date directly in the text area at the US format MM/DD/YYYY@HH:MM it converts it into the “US rich date format” right, and it is saved without problem. But then on the opportunity page and in the emails, that US format will be used, wich is not easily readable by french people.

    Is there a way for this plugin to use the date/time format configured in WordPress ?

    Regards,
    Clement

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Wired Impact

    (@wiredimpact)

    Thanks for reaching out Clement. Unfortunately, the datepicker functionality only works in English right now, but fixing this is a high priority item for us. We’re fairly busy with client work right now, but ensuring the datepicker works when used in other languages is at the top of our list of to dos.

    We really appreciate you reaching out and will let you know when we get this taken care of.

    Jonathan
    Wired Impact

    Thread Starter solidaritelocale

    (@solidaritelocale)

    It’s good to know that you are working on it !

    I got almost the same issue with the phone number format. The french format is quite different, so when the plugin applies the US format on it, it becomes difficult to read for french people.
    Even when I enter only numbers (ex: 0123456789) it transforms it into (012) 345-6789.

    Could you point me the file where I can change that ?
    Is the format applied only when the number is displayed, or is it written with this format in the database ?

    Note : If there is a way to change that, it should be adapted in the translation too :
    “Please enter your phone number in the format (000) 000-0000.”

    Thread Starter solidaritelocale

    (@solidaritelocale)

    Hi Jonathan,

    I’ve tried some new things:

    – changing the date format in the translation
    => the date & time is displayed in the right order for french readers, but days and months names are still in english

    – changing the locale and using strftime() rather than date()
    => the date & time are french-fliendly, at last!
    ==>> small problem : the “format string” used by stfrtime() is different from the one from date(), so the format strings in the translation have to be modified accordingly. (using % sign)
    ==>> other problem : I don’t know where to define the locale globally, so for now my way of doing it is quite dirty for now…

    – the datepicker won’t work at all, even with a clean install of your plugin: like I wrote in my first post, the date chosen with the datepicker is put in the form, but is disappear when I save the page.

    – I managed to display the phone number in the french standard, but one agin it’s hardcoded and dirty… maybe the phone format could be in the translation too, using regex, but I don’t have the knowledge to do that!

    —–
    examples:

    strftime instead of date:
    setlocale(LC_TIME, ‘fr’,’fr_FR’,’fr_FR.utf8′,’fra’);
    // $opp_time = date( __( ‘D, F d, Y g:i a’, ‘wired-impact-volunteer-management’ ), $start_date_time);
    $opp_time = strftime(“%A %d %B %Y %H:%M”, $start_date_time);

    phone number format:
    // $formatted_number = ‘(‘ . substr( $unformatted_number, 0, 3 ) . ‘) ‘. substr( $unformatted_number, 3, 3 ) . ‘-‘ . substr( $unformatted_number, 6 );
    $formatted_number = substr( $unformatted_number, 0, 2 ) . ‘ ‘ . substr( $unformatted_number, 2, 2 ) . ‘ ‘ . substr( $unformatted_number, 4, 2 ) . ‘ ‘ . substr( $unformatted_number, 6, 2 ) . ‘ ‘ . substr( $unformatted_number, 8 );

    Plugin Author Wired Impact

    (@wiredimpact)

    Clement, thanks a ton for all your detailed notes. We have been working on allowing for non-US dates and times to be saved and are pretty close to having a working solution. You can see the pull request at https://github.com/wiredimpact/wired-impact-volunteer-management/pull/12. Feel free to comment or make adjustments there since you are really well versed in the situation at this point.

    I’m going to leave this ticket open for now since we haven’t rolled out the fix quite yet.

    Jonathan

    Plugin Author Wired Impact

    (@wiredimpact)

    Clement, as I noted for the phone numbers, the datepicker now allows for full translation. It would be great if you could test it out with your own .po and .mo translation files so we can make sure it works as expected. Thanks a ton for all your help.

    Jonathan

    Thread Starter solidaritelocale

    (@solidaritelocale)

    Just like the phone numbers, everything here is working perfectly, congratulations!
    Dates and times are stored just fine, the display is using the format provided in the translation and the words in the right language. Perfect.

    Plugin Author Wired Impact

    (@wiredimpact)

    That’s great to hear Clement! Thanks a ton for testing it out for us. We really appreciate your help.

    Jonathan

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘non-US date format won’t save’ is closed to new replies.