From db0b72d08282e49c880780b62e4b9ac9ffa909df Mon Sep 17 00:00:00 2001 From: TJ Woon Date: Mon, 21 Sep 2015 15:19:28 +0800 Subject: [PATCH] Pass along the uiDateFormat option to the jQuery UI Datepicker plugin - so that date displayed in input follows our format --- src/date.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/date.js b/src/date.js index dcb2eed..4efbd3e 100644 --- a/src/date.js +++ b/src/date.js @@ -19,7 +19,9 @@ angular.module('ui.date', []) require:'?ngModel', link:function (scope, element, attrs, controller) { var getOptions = function () { - return angular.extend({}, uiDateConfig, scope.$eval(attrs.uiDate)); + var opts = {}; + if(attrs.uiDateFormat) opts.dateFormat = attrs.uiDateFormat; + return angular.extend(opts, uiDateConfig, scope.$eval(attrs.uiDate)); }; var initDateWidget = function () { var showing = false;