Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Commit b74a3e0

Browse files
committed
see #243 thanks to @bender404
1 parent 9f8e62f commit b74a3e0

File tree

7 files changed

+65
-11
lines changed

7 files changed

+65
-11
lines changed

‎bower.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angularjs-datepicker",
3-
"version": "2.1.13",
3+
"version": "2.1.14",
44
"description": "A datepicker directive for angularjs.",
55
"authors": [
66
"Filippo Oretti <filippo.oretti@gmail.com",

‎dist/angular-datepicker.css‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ datepicker, .datepicker, [datepicker],
110110
border-radius: 1px;
111111
}
112112
._720kb-datepicker-calendar-day:hover,
113-
._720kb-datepicker-calendar-day._720kb-datepicker-active,
114-
._720kb-datepicker-calendar-day._720kb-datepicker-today {
113+
._720kb-datepicker-calendar-day._720kb-datepicker-active {
115114
background: rgba(0, 0, 0, 0.03);
116115
}
117116
._720kb-datepicker-calendar-header a, ._720kb-datepicker-calendar-header a:hover {

‎dist/angular-datepicker.js‎

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,62 @@
276276

277277
$scope.year = Number($scope.year) + 1;
278278
}
279+
, localDateTimestamp = function localDateTimestamp(rawDate, dateFormatDefinition) {
280+
281+
var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|MMMM|MMM|MM|M|dd?d?|yy?yy?y?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g
282+
,formatDate,dateSplit, m, d, y, index, el, longName, shortName;
283+
284+
for (index = 0; index < datetime.MONTH.length; index += 1) {
285+
longName = datetime.MONTH[index];
286+
shortName = datetime.SHORTMONTH[index];
287+
288+
if (rawDate.indexOf(longName) !== -1) {
289+
rawDate = rawDate.replace(longName, index + 1);
290+
break;
291+
}
292+
293+
if (rawDate.indexOf(shortName) !== -1) {
294+
rawDate = rawDate.replace(shortName, index + 1);
295+
break;
296+
}
297+
}
298+
299+
dateSplit = rawDate
300+
.split(/\D/)
301+
.filter(function dateSplitFilter(item) {
302+
return item.length > 0;
303+
});
304+
305+
formatDate = dateFormatDefinition
306+
.match(formattingTokens)
307+
.filter(function fromatDateFilter(item) {
308+
return item.match(/^[a-zA-Z]+$/i) !== null;
309+
});
310+
311+
for (index = 0; index < formatDate.length; index += 1) {
312+
el = formatDate[index];
313+
314+
switch (true) {
315+
case el.indexOf('d') !== -1: {
316+
d = dateSplit[index];
317+
break;
318+
}
319+
case el.indexOf('M') !== -1: {
320+
m = dateSplit[index];
321+
break;
322+
}
323+
case el.indexOf('y') !== -1: {
324+
y = dateSplit[index];
325+
break;
326+
}
327+
default: {
328+
break;
329+
}
330+
}
331+
}
332+
333+
return new Date(y + '/' + m + '/' + d);
334+
}
279335
, setInputValue = function setInputValue() {
280336

281337
if ($scope.isSelectableMinDate($scope.year + '/' + $scope.monthNumber + '/' + $scope.day) &&
@@ -619,9 +675,8 @@
619675
thisInput[0].value.length > 0) {
620676

621677
try {
622-
623678
if (dateFormat) {
624-
date = newDate($filter('date')(thisInput[0].value.toString(), dateFormat));
679+
date = localDateTimestamp(thisInput[0].value.toString(), dateFormat);
625680
} else {
626681
date = new Date(thisInput[0].value.toString());
627682
}

‎dist/angular-datepicker.min.css‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /