{"action":"created","issue":{"url":"https://api.github.com/repos/dalelotts/angular-bootstrap-datetimepicker/issues/212","labels_url":"https://api.github.com/repos/dalelotts/angular-bootstrap-datetimepicker/issues/212/labels{/name}","comments_url":"https://api.github.com/repos/dalelotts/angular-bootstrap-datetimepicker/issues/212/comments","events_url":"https://api.github.com/repos/dalelotts/angular-bootstrap-datetimepicker/issues/212/events","html_url":"https://github.com/dalelotts/angular-bootstrap-datetimepicker/issues/212","id":103271322,"number":212,"title":"New option: \"format\"","user":{"login":"maxlabelle","id":10326557,"avatar_url":"https://avatars.githubusercontent.com/u/10326557?v=3","gravatar_id":"","url":"https://api.github.com/users/maxlabelle","html_url":"https://github.com/maxlabelle","followers_url":"https://api.github.com/users/maxlabelle/followers","following_url":"https://api.github.com/users/maxlabelle/following{/other_user}","gists_url":"https://api.github.com/users/maxlabelle/gists{/gist_id}","starred_url":"https://api.github.com/users/maxlabelle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxlabelle/subscriptions","organizations_url":"https://api.github.com/users/maxlabelle/orgs","repos_url":"https://api.github.com/users/maxlabelle/repos","events_url":"https://api.github.com/users/maxlabelle/events{/privacy}","received_events_url":"https://api.github.com/users/maxlabelle/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-26T13:33:59Z","updated_at":"2015-08-26T17:54:55Z","closed_at":"2015-08-26T17:54:55Z","body":"Hi,\r\n\r\nI really like this project but I needed to have the returned date within the input to be formatted. So I added a new \"format\" option. You can specify a moment-like format string that will format the returned date. \r\n\r\nie;\r\n\r\n&lt;datetimepicker data-ng-model=\"data.dateDropDownInput\" data-datetimepicker-config=\"{ dropdownSelector: '#dropdown2', format: 'YYYY-MM-DD HH-mm' }\"/&gt;\r\n\r\n--- line 29 @ datetimepicket.js\r\n\r\n  angular.module('ui.bootstrap.datetimepicker', [])\r\n    .constant('dateTimePickerConfig', {\r\n      dropdownSelector: null,\r\n      minuteStep: 5,\r\n      minView: 'minute',\r\n      startView: 'day',\r\n      format: \"YYYY-MM-DD HH:mm\"\r\n    })\r\n\r\n--- --- line 63 @ datetimepicket.js\r\n\r\n        var validOptions = ['startView', 'minView', 'minuteStep', 'dropdownSelector', 'format'];\r\n\r\n--- line 357 @ datetimepicket.js\r\n\r\n              if (configuration.format) {\r\n                ngModelController.$setViewValue(moment(newDate).format(configuration.format));\r\n              }"},"comment":{"url":"https://api.github.com/repos/dalelotts/angular-bootstrap-datetimepicker/issues/comments/135123075","html_url":"https://github.com/dalelotts/angular-bootstrap-datetimepicker/issues/212#issuecomment-135123075","issue_url":"https://api.github.com/repos/dalelotts/angular-bootstrap-datetimepicker/issues/212","id":135123075,"user":{"login":"dalelotts","id":2121006,"avatar_url":"https://avatars.githubusercontent.com/u/2121006?v=3","gravatar_id":"","url":"https://api.github.com/users/dalelotts","html_url":"https://github.com/dalelotts","followers_url":"https://api.github.com/users/dalelotts/followers","following_url":"https://api.github.com/users/dalelotts/following{/other_user}","gists_url":"https://api.github.com/users/dalelotts/gists{/gist_id}","starred_url":"https://api.github.com/users/dalelotts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dalelotts/subscriptions","organizations_url":"https://api.github.com/users/dalelotts/orgs","repos_url":"https://api.github.com/users/dalelotts/repos","events_url":"https://api.github.com/users/dalelotts/events{/privacy}","received_events_url":"https://api.github.com/users/dalelotts/received_events","type":"User","site_admin":false},"created_at":"2015-08-26T17:54:55Z","updated_at":"2015-08-26T17:54:55Z","body":"Thanks @maxlabelle for the info. I made an intentional, but perhaps confusing design decision early on that separated the value stored in the model from the way it is presented.\r\n\r\nSeparating the concerns means that I can store a raw date object in the model, but present that date in the UI in any format that makes sense to the user. (i.e. store a date object but display it using the users locale settings) Without this separation, the UI is forced to present the data in a format understood by the server, which may not be ideal for the user.\r\n\r\nThe https://github.com/dalelotts/angular-date-time-input project is meant to handle the presentation layer -( it is a bit out of date and my not work in its current state) but by combining these two directives you get a complete separation of model and presentation layers.\r\n\r\n"}}