{"action":"created","issue":{"url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/267","labels_url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/267/labels{/name}","comments_url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/267/comments","events_url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/267/events","html_url":"https://github.com/WebDevStudios/CMB2/issues/267","id":64783559,"number":267,"title":"date picker fails when wordpress language isn't set to English.","user":{"login":"yivi","id":1815039,"avatar_url":"https://avatars.githubusercontent.com/u/1815039?v=3","gravatar_id":"","url":"https://api.github.com/users/yivi","html_url":"https://github.com/yivi","followers_url":"https://api.github.com/users/yivi/followers","following_url":"https://api.github.com/users/yivi/following{/other_user}","gists_url":"https://api.github.com/users/yivi/gists{/gist_id}","starred_url":"https://api.github.com/users/yivi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yivi/subscriptions","organizations_url":"https://api.github.com/users/yivi/orgs","repos_url":"https://api.github.com/users/yivi/repos","events_url":"https://api.github.com/users/yivi/events{/privacy}","received_events_url":"https://api.github.com/users/yivi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-27T15:23:57Z","updated_at":"2015-04-04T14:06:53Z","closed_at":null,"body":"The configuration for my date field is this:\r\n\r\n```\r\n$main->add_field(\r\n\t\t[\r\n\t\t\t'name' => __( 'Fecha', 'ojiva-plugin' ),\r\n\t\t\t'id'   => $prefix . 'fecha_realizacion',\r\n\t\t\t'type' => 'text_date_timestamp',\r\n\t\t\t'date_format' => \"d/m/Y\",\r\n\t\t]\r\n\t);\r\n```\r\n\r\nIf WP is set to English...\r\n![general_settings_ _ojiva_ _wordpress](https://cloud.githubusercontent.com/assets/1815039/6870482/a0c7c214-d49c-11e4-9308-d0d72c8d96a6.png)\r\n\r\n...then the field works, although it ignores my `date_format` settings (should be 04/03/2015):\r\n![editar_portfolio_ _ojiva_ _wordpress](https://cloud.githubusercontent.com/assets/1815039/6870532/04bbdd8c-d49d-11e4-95c5-a37705cfbf16.png)\r\n\r\nBut at least, it works, displays incorrectly but saves correctly.\r\n\r\nIf I then change WP language to Spanish:\r\n![ajustes_generales_ _ojiva_ _wordpress](https://cloud.githubusercontent.com/assets/1815039/6870558/2edd26ca-d49d-11e4-9aa0-896a8dde5836.png)\r\n\r\nThe date picker just wont work:\r\n![editar_portfolio_ _ojiva_ _wordpress](https://cloud.githubusercontent.com/assets/1815039/6870581/4d81522c-d49d-11e4-867f-154486cff913.png)\r\n\r\nIt wont display the date correctly, nor save it in the DB.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/comments/89583910","html_url":"https://github.com/WebDevStudios/CMB2/issues/267#issuecomment-89583910","issue_url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/267","id":89583910,"user":{"login":"yivi","id":1815039,"avatar_url":"https://avatars.githubusercontent.com/u/1815039?v=3","gravatar_id":"","url":"https://api.github.com/users/yivi","html_url":"https://github.com/yivi","followers_url":"https://api.github.com/users/yivi/followers","following_url":"https://api.github.com/users/yivi/following{/other_user}","gists_url":"https://api.github.com/users/yivi/gists{/gist_id}","starred_url":"https://api.github.com/users/yivi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yivi/subscriptions","organizations_url":"https://api.github.com/users/yivi/orgs","repos_url":"https://api.github.com/users/yivi/repos","events_url":"https://api.github.com/users/yivi/events{/privacy}","received_events_url":"https://api.github.com/users/yivi/received_events","type":"User","site_admin":false},"created_at":"2015-04-04T14:06:53Z","updated_at":"2015-04-04T14:06:53Z","body":"Sorry, wp forums are horrible and hard to search/use, thought this was the proper place to report bugs and contribute back... Isn't it?\r\n\r\nAnyway, I found what the problem is. There is a mistranslation in `cm2-es_ES.po`, line 362.\r\n\r\n`mm/dd/yy` to `dd / mm / aa`, which doesn't make a lot of sense (`aa` isn't a valid `formatDate` [format] (https://api.jqueryui.com/datepicker/#utility-formatDate)), that probably happened because in CMB2_hookup.php it does:\r\n`'dateFormat'      => __( 'mm/dd/yy', 'cmb2' ),`\r\nWhere it could probably do better by doing \r\n`'dateFormat'      => _x( 'mm/dd/yy', 'Valid formatDate string for jquery-ui datepicker','cmb2' ),`\r\n\r\nI also saw there were a couple Spanish translations missing. I'll just make a PR with these fixes and additions.\r\nRegards."}}