From 8aa021c26345a063f3f3eaf7b1d36692820662e3 Mon Sep 17 00:00:00 2001 From: francisco gerardo neri andriano Date: Fri, 11 Jan 2019 14:05:41 -0600 Subject: [PATCH] adding date format names supporting --- src/js/angular-datepicker.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/js/angular-datepicker.js b/src/js/angular-datepicker.js index 971dbc9..0cac0e3 100644 --- a/src/js/angular-datepicker.js +++ b/src/js/angular-datepicker.js @@ -303,6 +303,33 @@ return item.length > 0; }); + switch(dateFormatDefinition){ + case 'medium': + dateFormatDefinition = 'MMM d, y h:mm:ss a'; + break; + case 'short': + dateFormatDefinition = 'M/d/yy h:mm a'; + break; + case 'fullDate': + dateFormatDefinition = 'EEEE, MMMM d, y'; + break; + case 'longDate': + dateFormatDefinition = 'MMMM d, y'; + break; + case 'mediumDate': + dateFormatDefinition = 'MMM d, y'; + break; + case 'shortDate': + dateFormatDefinition = 'M/d/yy'; + break; + case 'mediumTime': + dateFormatDefinition = 'h:mm:ss a'; + break; + case 'shortTime': + dateFormatDefinition = 'h:mm a'; + break; + } + formatDate = dateFormatDefinition .match(formattingTokens) .filter(function fromatDateFilter(item) {