{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/12102","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/12102/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/12102/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/12102/events","html_url":"https://github.com/joomla/joomla-cms/pull/12102","id":178012207,"number":12102,"title":"Localise the format for the calendar formfield","user":{"login":"Bakual","id":1018684,"avatar_url":"https://avatars1.githubusercontent.com/u/1018684?v=3","gravatar_id":"","url":"https://api.github.com/users/Bakual","html_url":"https://github.com/Bakual","followers_url":"https://api.github.com/users/Bakual/followers","following_url":"https://api.github.com/users/Bakual/following{/other_user}","gists_url":"https://api.github.com/users/Bakual/gists{/gist_id}","starred_url":"https://api.github.com/users/Bakual/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bakual/subscriptions","organizations_url":"https://api.github.com/users/Bakual/orgs","repos_url":"https://api.github.com/users/Bakual/repos","events_url":"https://api.github.com/users/Bakual/events{/privacy}","received_events_url":"https://api.github.com/users/Bakual/received_events","type":"User","site_admin":false},"labels":[{"id":198658453,"url":"https://api.github.com/repos/joomla/joomla-cms/labels/Language%20Change","name":"Language Change","color":"eb6420","default":false},{"id":415102761,"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-3.7.x","name":"PR-3.7.x","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/joomla/joomla-cms/milestones/14","html_url":"https://github.com/joomla/joomla-cms/milestone/14","labels_url":"https://api.github.com/repos/joomla/joomla-cms/milestones/14/labels","id":1750036,"number":14,"title":"Joomla 3.7.0","description":"","creator":{"login":"brianteeman","id":1296369,"avatar_url":"https://avatars0.githubusercontent.com/u/1296369?v=3","gravatar_id":"","url":"https://api.github.com/users/brianteeman","html_url":"https://github.com/brianteeman","followers_url":"https://api.github.com/users/brianteeman/followers","following_url":"https://api.github.com/users/brianteeman/following{/other_user}","gists_url":"https://api.github.com/users/brianteeman/gists{/gist_id}","starred_url":"https://api.github.com/users/brianteeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianteeman/subscriptions","organizations_url":"https://api.github.com/users/brianteeman/orgs","repos_url":"https://api.github.com/users/brianteeman/repos","events_url":"https://api.github.com/users/brianteeman/events{/privacy}","received_events_url":"https://api.github.com/users/brianteeman/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":1083,"state":"open","created_at":"2016-05-05T16:42:34Z","updated_at":"2017-03-18T17:06:45Z","due_on":null,"closed_at":null},"comments":18,"created_at":"2016-09-20T09:36:46Z","updated_at":"2017-03-18T19:52:23Z","closed_at":"2016-10-01T07:40:59Z","pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/12102","html_url":"https://github.com/joomla/joomla-cms/pull/12102","diff_url":"https://github.com/joomla/joomla-cms/pull/12102.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/12102.patch"},"body":"With the current calendar we can specify the date format in the XML file. Eg \"%Y-%m-%d %H:%M:%S\". However that is hardcoded and the same for every language.\nThis PR proposes that we can set the calendar so it adjusts the format to the active language.\n### Summary of Changes\n\nIntroduces two new attributes `showtime` and `translateformat` for the JFormFieldCalendar:\n- `translateformat`: If set to true, the calendar will use a language string to determine the format. The `format` attribute is ignored. If false, the `format` attribute is used (same behaviour as today).\n- `showtime`: If set to true and `translateformat` is true, the language key `DATE_FORMAT_CALENDAR_DATETIME` is used, otherwise `DATE_FORMAT_CALENDAR_DATE`.\n  Please note that this attribute is also used in the PR #11138 to specify if the calendar should show a timefield or not. Imho it makes sense to use the same attribute here.\n### Testing Instructions\n1. Apply PR\n2. Add the new language strings to your second language you have installed. Eg for de-DE add this to both de-DE.ini files (frontend and backend):\n\n```\nDATE_FORMAT_CALENDAR_DATE=\"%d.%m.%Y\"\nDATE_FORMAT_CALENDAR_DATETIME=\"%d.%m.%Y %H:%M:%S\"\n```\n1. Check backend article edits and watch the format changing from YYYY-MM-DD to DD.MM.YYYY if you change the language.\n2. Active the user - profile plugin and edit your profil in frontend. Check the birthday field and watch the change in format. Also this field should **not** show the time.\n### Current Limitations\n- This PR so far only changed the backend article form and the frontend profile form. If accepted it can of course be expanded to all other forms as well (just needs change in the XML).\n- I honestly don't know if this will work for all languages and possible date formats. That is something the language pack creators have to test when creating the language strings.\n### Documentation Changes Required\n\nNew attributes need to be added to https://docs.joomla.org/Calendar_form_field_type\n"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/287570356","html_url":"https://github.com/joomla/joomla-cms/pull/12102#issuecomment-287570356","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/12102","id":287570356,"user":{"login":"Bakual","id":1018684,"avatar_url":"https://avatars1.githubusercontent.com/u/1018684?v=3","gravatar_id":"","url":"https://api.github.com/users/Bakual","html_url":"https://github.com/Bakual","followers_url":"https://api.github.com/users/Bakual/followers","following_url":"https://api.github.com/users/Bakual/following{/other_user}","gists_url":"https://api.github.com/users/Bakual/gists{/gist_id}","starred_url":"https://api.github.com/users/Bakual/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bakual/subscriptions","organizations_url":"https://api.github.com/users/Bakual/orgs","repos_url":"https://api.github.com/users/Bakual/repos","events_url":"https://api.github.com/users/Bakual/events{/privacy}","received_events_url":"https://api.github.com/users/Bakual/received_events","type":"User","site_admin":false},"created_at":"2017-03-18T19:52:23Z","updated_at":"2017-03-18T19:52:23Z","body":"Perfect, thanks a lot for taking care of it!"}}
{"actor":{"display_login":"Bakual"}}