Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.

date format strings support #331

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/js/angular-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down