Title: Localized date format causes error when saving a workflow
Last modified: August 22, 2016

---

# Localized date format causes error when saving a workflow

 *  Resolved [swemaniac](https://wordpress.org/support/users/swemaniac/)
 * (@swemaniac)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/localized-date-format-causes-error-when-saving-a-workflow/)
 * Hi guys,
 * Using the current free version of the plugin, I can’t save a workflow without
   getting a “Call to a member function format() on boolean” error.
 * This is apparently related to the `format_date_for_db` function and particularly
   the `$date = DateTime::createFromFormat(get_option( 'date_format' ), $ddate );`
   line (createFromFormat returning FALSE, indicating failure). (oasis-workflow/
   includes/workflow-base.php on line 278).
 * My date format is set to F j, Y and my locale is sv_SE so the month names should
   be capitalized. But your default date strings for the workflow due dates are 
   in lowercase which causes this error (“februari” vs “Februari”).
 * If I simply use the date picker to pick a date, it inserts the correct format(
   capitalized month name) into the due date box and I can save.
 * [https://wordpress.org/plugins/oasis-workflow/](https://wordpress.org/plugins/oasis-workflow/)

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

 *  Plugin Author [nuggetsol](https://wordpress.org/support/users/nuggetsol/)
 * (@nuggetsol)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/localized-date-format-causes-error-when-saving-a-workflow/#post-5803966)
 * Let me look into the issue and get back to you.
 * I’m guessing you are running on PHP 5.3 and above.
 *  Thread Starter [swemaniac](https://wordpress.org/support/users/swemaniac/)
 * (@swemaniac)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/localized-date-format-causes-error-when-saving-a-workflow/#post-5803967)
 * Yep! 5.6 actually, with WP4.1 on centos 6.5. Thank you.
 *  Plugin Author [nuggetsol](https://wordpress.org/support/users/nuggetsol/)
 * (@nuggetsol)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/localized-date-format-causes-error-when-saving-a-workflow/#post-5803973)
 * I just verified with English locale and the default date comes out to be upper
   case date – February 18, 2015
 * I’m going to try with sv_SE locale and see if that helps to replicate the issue.
 *  Thread Starter [swemaniac](https://wordpress.org/support/users/swemaniac/)
 * (@swemaniac)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/localized-date-format-causes-error-when-saving-a-workflow/#post-5803976)
 * I’m sorry I had meant the other way around in my post – the Swedish locale uses
   lowercase month names, not uppercase (i.e. the other way around). So that’s what’s
   causing the problem.
 * Here’s a shot of my relevant settings: [http://snag.gy/Iah0s.jpg](http://snag.gy/Iah0s.jpg)
 * EDIT: Hmm which is weird, why would the built-in DateTime format fail when the
   format is correct from the start.. Mismatch in some locale settings somewhere?
   Maybe a server issue on my part? I’ll have to look into it as well..
 * But I really don’t like being presented with fatal errors anyway 😉
 *  Plugin Author [nuggetsol](https://wordpress.org/support/users/nuggetsol/)
 * (@nuggetsol)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/localized-date-format-causes-error-when-saving-a-workflow/#post-5804007)
 * found the issue.
 * essentially, the jquery ui datepicker, doesn’t have the language specific files
   and with a date which has display and edit, we should convert it into a default
   date format to begin with.
 * I will add a new function format_date_for_display_and_edit, so that we do not
   see the error.
 * As regards to showing the dates in specific locale, I will have to dig further
   and see how I can allow to load the date specific locale files and use jquery
   datepicker regional settings.
 * Just before I publish a new version, I would like to make sure it works for you.
 * There isn’t a good way to send files here, so can you please send me a message
   via [https://www.oasisworkflow.com/submit-a-query](https://www.oasisworkflow.com/submit-a-query)
   and I can send you the modified files. There are only two files which are modified.
 * BTW, I also do not like fatal errors and warnings and I take utmost care to make
   sure the plugin doesn’t have any PHP warnings 🙂
 *  Thread Starter [swemaniac](https://wordpress.org/support/users/swemaniac/)
 * (@swemaniac)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/localized-date-format-causes-error-when-saving-a-workflow/#post-5804011)
 * Sure thing, thanks mate. On a similar note, do you have localization support?
   I’d be willing to translate to Swedish.
 *  Plugin Author [nuggetsol](https://wordpress.org/support/users/nuggetsol/)
 * (@nuggetsol)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/localized-date-format-causes-error-when-saving-a-workflow/#post-5804012)
 * That would be perfect. I did got some help on other languages and it would be
   great to have a swedish translation for the plugin.
 * Thanks again for reporting the error and helping with the swedish translation.
 *  Plugin Author [nuggetsol](https://wordpress.org/support/users/nuggetsol/)
 * (@nuggetsol)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/localized-date-format-causes-error-when-saving-a-workflow/#post-5804048)
 * I hope you received my email. Let me know if the change fixes the issue.
 *  Thread Starter [swemaniac](https://wordpress.org/support/users/swemaniac/)
 * (@swemaniac)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/localized-date-format-causes-error-when-saving-a-workflow/#post-5804067)
 * Yes, I’ll test this at work tomorrow 🙂
 *  Thread Starter [swemaniac](https://wordpress.org/support/users/swemaniac/)
 * (@swemaniac)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/localized-date-format-causes-error-when-saving-a-workflow/#post-5804134)
 * I’ve just tested it and it works as expected, you can push this update 🙂 Thanks!
 * Will you let me know how you would like me to proceed with the translation?
 *  Thread Starter [swemaniac](https://wordpress.org/support/users/swemaniac/)
 * (@swemaniac)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/localized-date-format-causes-error-when-saving-a-workflow/#post-5804135)
 * (resolved)
 *  Plugin Author [nuggetsol](https://wordpress.org/support/users/nuggetsol/)
 * (@nuggetsol)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/localized-date-format-causes-error-when-saving-a-workflow/#post-5804180)
 * Thanks for confirming the fix. I have released a new version of the plugin with
   the fix.
 * As regards to the translation, send me the translated .mo and .po files over 
   the email and I can include the same with the next release.

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

The topic ‘Localized date format causes error when saving a workflow’ is closed 
to new replies.

 * ![](https://ps.w.org/oasis-workflow/assets/icon-256x256.png?rev=1890301)
 * [Oasis Workflow](https://wordpress.org/plugins/oasis-workflow/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/oasis-workflow/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/oasis-workflow/)
 * [Active Topics](https://wordpress.org/support/plugin/oasis-workflow/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/oasis-workflow/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/oasis-workflow/reviews/)

 * 12 replies
 * 2 participants
 * Last reply from: [nuggetsol](https://wordpress.org/support/users/nuggetsol/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/localized-date-format-causes-error-when-saving-a-workflow/#post-5804180)
 * Status: resolved