{"action":"created","issue":{"url":"https://api.github.com/repos/alenaksu/mdPickers/issues/150","repository_url":"https://api.github.com/repos/alenaksu/mdPickers","labels_url":"https://api.github.com/repos/alenaksu/mdPickers/issues/150/labels{/name}","comments_url":"https://api.github.com/repos/alenaksu/mdPickers/issues/150/comments","events_url":"https://api.github.com/repos/alenaksu/mdPickers/issues/150/events","html_url":"https://github.com/alenaksu/mdPickers/issues/150","id":173969277,"number":150,"title":"options.displayFormat is overridden, thus not applying","user":{"login":"trichetriche","id":7789922,"avatar_url":"https://avatars.githubusercontent.com/u/7789922?v=3","gravatar_id":"","url":"https://api.github.com/users/trichetriche","html_url":"https://github.com/trichetriche","followers_url":"https://api.github.com/users/trichetriche/followers","following_url":"https://api.github.com/users/trichetriche/following{/other_user}","gists_url":"https://api.github.com/users/trichetriche/gists{/gist_id}","starred_url":"https://api.github.com/users/trichetriche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trichetriche/subscriptions","organizations_url":"https://api.github.com/users/trichetriche/orgs","repos_url":"https://api.github.com/users/trichetriche/repos","events_url":"https://api.github.com/users/trichetriche/events{/privacy}","received_events_url":"https://api.github.com/users/trichetriche/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-30T09:18:37Z","updated_at":"2016-08-31T13:17:40Z","closed_at":null,"body":"When calling the mdPicker service, you can give it a `displayFormat` parameter which allows the date on the side of the calendar to be changed.\r\n\r\nBut no matter the value, it's overridden by a constant in the code, in the DatePicker file at line 119 : \r\n\r\n```\r\nthis.$get = [\"$mdDialog\", function($mdDialog) {\r\n       var datePicker = function(currentDate, options) {\r\n           if (!angular.isDate(currentDate)) currentDate = Date.now();\r\n           if (!angular.isObject(options)) options = {};\r\n\r\n            // -------------------- RIGHT HERE --------------------------------\r\n           options.displayFormat = DISPLAY_FORMAT;    \r\n\r\n           return $mdDialog.show({\r\n               controller:  ['$scope', '$mdDialog', '$mdMedia', '$timeout', 'currentDate', 'options', DatePickerCtrl],\r\n               controllerAs: 'datepicker',\r\n               clickOutsideToClose: true,\r\n               template: '<md-dialog aria-label=\"\" class=\"mdp-datepicker\" ng-class=\"{ \\'portrait\\': !$mdMedia(\\'gt-xs\\') }\">' +\r\n                           '<md-dialog-content layout=\"row\" layout-wrap>' +\r\n                               '<div layout=\"column\" layout-align=\"start center\">' +\r\n                                   '<md-toolbar layout-align=\"start start\" flex class=\"mdp-datepicker-date-wrapper md-hue-1 md-primary\" layout=\"column\">' +\r\n                                       '<span class=\"mdp-datepicker-year\" ng-click=\"datepicker.showYear()\" ng-class=\"{ \\'active\\': datepicker.selectingYear }\">{{ datepicker.date.format(\\'YYYY\\') }}</span>' +\r\n                                       '<span class=\"mdp-datepicker-date\" ng-click=\"datepicker.showCalendar()\" ng-class=\"{ \\'active\\': !datepicker.selectingYear }\">{{ datepicker.date.format(datepicker.displayFormat) }}</span> ' +\r\n                                   '</md-toolbar>' +\r\n                               '</div>' +\r\n                               '<div>' +\r\n                                   '<div class=\"mdp-datepicker-select-year mdp-animation-zoom\" layout=\"column\" layout-align=\"center start\" ng-if=\"datepicker.selectingYear\">' +\r\n                                       '<md-virtual-repeat-container md-auto-shrink md-top-index=\"datepicker.yearTopIndex\">' +\r\n                                           '<div flex md-virtual-repeat=\"item in datepicker.yearItems\" md-on-demand class=\"repeated-year\">' +\r\n                                               '<span class=\"md-button\" ng-click=\"datepicker.selectYear(item)\" md-ink-ripple ng-class=\"{ \\'md-primary current\\': item == year }\">{{ item }}</span>' +\r\n                                           '</div>' +\r\n                                       '</md-virtual-repeat-container>' +\r\n                                   '</div>' +\r\n                                   '<mdp-calendar ng-if=\"!datepicker.selectingYear\" class=\"mdp-animation-zoom\" date=\"datepicker.date\" min-date=\"datepicker.minDate\" date-filter=\"datepicker.dateFilter\" max-date=\"datepicker.maxDate\"></mdp-calendar>' +\r\n                                   '<md-dialog-actions layout=\"row\">' +\r\n                                       '<span flex></span>' +\r\n                                       '<md-button ng-click=\"datepicker.cancel()\" aria-label=\"' + LABEL_CANCEL + '\">' + LABEL_CANCEL + '</md-button>' +\r\n                                       '<md-button ng-click=\"datepicker.confirm()\" class=\"md-primary\" aria-label=\"' + LABEL_OK + '\">' + LABEL_OK + '</md-button>' +\r\n                                   '</md-dialog-actions>' +\r\n                               '</div>' +\r\n                           '</md-dialog-content>' +\r\n                       '</md-dialog>',\r\n               targetEvent: options.targetEvent,\r\n               locals: {\r\n                   currentDate: currentDate,\r\n                   options: options\r\n               },\r\n               skipHide: true\r\n           });\r\n       };\r\n\r\n       return datePicker;\r\n   }];\r\n```\r\n\r\nA function `setDisplayFormat` exists but is never called though. "},"comment":{"url":"https://api.github.com/repos/alenaksu/mdPickers/issues/comments/243760573","html_url":"https://github.com/alenaksu/mdPickers/issues/150#issuecomment-243760573","issue_url":"https://api.github.com/repos/alenaksu/mdPickers/issues/150","id":243760573,"user":{"login":"BkSouX","id":7347786,"avatar_url":"https://avatars.githubusercontent.com/u/7347786?v=3","gravatar_id":"","url":"https://api.github.com/users/BkSouX","html_url":"https://github.com/BkSouX","followers_url":"https://api.github.com/users/BkSouX/followers","following_url":"https://api.github.com/users/BkSouX/following{/other_user}","gists_url":"https://api.github.com/users/BkSouX/gists{/gist_id}","starred_url":"https://api.github.com/users/BkSouX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BkSouX/subscriptions","organizations_url":"https://api.github.com/users/BkSouX/orgs","repos_url":"https://api.github.com/users/BkSouX/repos","events_url":"https://api.github.com/users/BkSouX/events{/privacy}","received_events_url":"https://api.github.com/users/BkSouX/received_events","type":"User","site_admin":false},"created_at":"2016-08-31T13:17:40Z","updated_at":"2016-08-31T13:17:40Z","body":"Hi @trichetriche , you have to configure the provider in the config phase like this \r\n\r\n`.config(($mdpDatePickerProvider) => {\r\n    'ngInject';\r\n    $mdpDatePickerProvider.setDisplayFormat('DD/MM/YYYY');\r\n  })\r\n`\r\n\r\n(im using es6)"}}
{"actor":{"display_login":"BkSouX"}}