From f573ae5919c16dc96d4a4f321a996e3918013cda Mon Sep 17 00:00:00 2001 From: Dzulqarnain Nasir Date: Wed, 24 Sep 2014 15:44:32 +0300 Subject: [PATCH] * Updated Gruntfile.js. * Updated version number. * Directive is now part of the whole plugin. --- Gruntfile.js | 31 +- bower.json | 2 +- dateparser.directive.js | 18 +- dateparser.js | 11 - dist/angular-dateparser.js | 445 +++++++++++++++-------------- dist/angular-dateparser.min.js | 13 +- dist/angular-dateparser.min.js.map | 2 +- package.json | 4 +- test/dateparser.directive.spec.js | 4 +- 9 files changed, 269 insertions(+), 261 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index ee429e9..1583797 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,5 +1,5 @@ -module.exports = function ( grunt ) { - +module.exports = function (grunt) { + grunt.loadNpmTasks('grunt-karma'); var taskConfig = { @@ -13,35 +13,42 @@ module.exports = function ( grunt ) { runnerPort: 9101, background: true }, - continuous: { + single: { singleRun: true } }, uglify: { - development: { + raw: { options: { beautify: true, sourceMap: false, mangle: false, compress: false, - preserveComments: 'some' + preserveComments: 'some', + banner: ['/*!', ' * <%= pkg.name %> <%= pkg.version %>', ' * <%= pkg.homepage %>', ' * Copyright <%= grunt.template.today("yyyy") %>, <%= pkg.author %>', ' * Licensed under: <%= pkg.licenses.type %> (<%= pkg.licenses.url %>)\n */\n\n'].join('\n'), + enclose: { + angular: 'angular' + } }, files: { - 'dist/angular-dateparser.js': ['dateparser.js'] + 'dist/angular-dateparser.js': ['dateparser.js', 'dateparser.directive.js'] } }, - production: { + prod: { options: { sourceMap: true, mangle: true, compress: { drop_console: true }, - preserveComments: 'some' + preserveComments: false, + banner: '/*! <%= pkg.name %> <%= pkg.version %> | ' + + '(c) <%= grunt.template.today("yyyy") %>, <%= pkg.author %> | ' + + '<%= pkg.licenses.type %> (<%= pkg.licenses.url %>) */' }, files: { - 'dist/angular-dateparser.min.js': ['dateparser.js'] + 'dist/angular-dateparser.min.js': ['dist/angular-dateparser.js'] } } }, @@ -54,6 +61,6 @@ module.exports = function ( grunt ) { grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.registerTask('default', ['karma:continuous']); - grunt.registerTask('build', ['karma:continuous', 'clean', 'uglify']); -}; + grunt.registerTask('default', ['karma:single']); + grunt.registerTask('build', [ 'karma:single', 'clean', 'uglify']); +}; \ No newline at end of file diff --git a/bower.json b/bower.json index 982f1ed..4e7582a 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angular-dateParser", - "version": "1.0.9", + "version": "1.0.10", "homepage": "https://github.com/dnasir/angular-dateParser", "authors": [ "Dzulqarnain Nasir" diff --git a/dateparser.directive.js b/dateparser.directive.js index 05d1b8c..c33328b 100644 --- a/dateparser.directive.js +++ b/dateparser.directive.js @@ -11,7 +11,7 @@ angular.module('dateParserDirective', ['dateParser']) ngModel.$render(); }); - var parseDate = function(viewValue) { + ngModel.$parsers.unshift(function(viewValue) { var date = $dateParser(viewValue, dateFormat); if(isNaN(date)) { @@ -21,20 +21,18 @@ angular.module('dateParserDirective', ['dateParser']) } return date; - }; - ngModel.$parsers.unshift(parseDate); + }); + // Make sure we render using our format on init ngModel.$render = function() { - var date = ngModel.$modelValue ? dateFilter(ngModel.$modelValue, dateFormat) : ''; - element.val(date); + element.val(ngModel.$modelValue ? dateFilter(ngModel.$modelValue, dateFormat) : undefined); scope.ngModel = ngModel.$modelValue; }; - element.bind('input change keyup', function() { - scope.$apply(function() { - scope.ngModel = ngModel.$modelValue; - }); - }); + // Format the new model value before it is displayed in the editor + ngModel.$formatters.push(function(modelValue) { + return modelValue ? dateFilter(modelValue, dateFormat) : ''; + }); } }; }]); \ No newline at end of file diff --git a/dateparser.js b/dateparser.js index 6ebab9a..d6f3e1f 100644 --- a/dateparser.js +++ b/dateparser.js @@ -1,14 +1,3 @@ -/*! - * Angular DateParser 1.0.9 - * https://github.com/dnasir/angular-dateParser - * - * Copyright 2013, Dzulqarnain Nasir - * http://www.dnasir.com - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/MIT - */ - angular.module('dateParser', []) .factory('dateParserHelpers', [function() { diff --git a/dist/angular-dateparser.js b/dist/angular-dateparser.js index 7600a04..bafa52f 100644 --- a/dist/angular-dateparser.js +++ b/dist/angular-dateparser.js @@ -1,237 +1,260 @@ -/*! - * Angular DateParser 1.0.9 - * https://github.com/dnasir/angular-dateParser - * - * Copyright 2013, Dzulqarnain Nasir - * http://www.dnasir.com - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/MIT +/*! + * angular-dateParser 1.0.10 + * https://github.com/dnasir/angular-dateParser + * Copyright 2014, Dzulqarnain Nasir + * Licensed under: MIT (http://www.opensource.org/licenses/MIT) */ -angular.module("dateParser", []).factory("dateParserHelpers", [ function() { - "use strict"; - return { - hasOnlyIntegers: function(string) { - if (!string) return false; - var digits = "1234567890"; - for (var i = 0; i < string.length; i++) { - if (digits.indexOf(string.charAt(i)) == -1) return false; - } - return true; - }, - getInteger: function(string, startPoint, minLength, maxLength) { - for (var i = maxLength; i >= minLength; i--) { - var extracted = string.substring(startPoint, startPoint + i); - if (this.hasOnlyIntegers(extracted)) { - return extracted; + +(function(angular) { + angular.module("dateParser", []).factory("dateParserHelpers", [ function() { + var cache = {}; + return { + getInteger: function(string, startPoint, minLength, maxLength) { + var val = string.substring(startPoint); + var matcher = cache[minLength + "_" + maxLength]; + if (!matcher) { + matcher = new RegExp("^(\\d{" + minLength + "," + maxLength + "})"); + cache[minLength + "_" + maxLength] = matcher; } + var match = matcher.exec(val); + if (match) { + return match[1]; + } + return null; } - return null; - } - }; -} ]).factory("$dateParser", [ "$locale", "dateParserHelpers", function($locale, dateParserHelpers) { - "use strict"; - var datetimeFormats = $locale.DATETIME_FORMATS; - var monthNames = datetimeFormats.MONTH.concat(datetimeFormats.SHORTMONTH); - var dayNames = datetimeFormats.DAY.concat(datetimeFormats.SHORTDAY); - return function(val, format) { - if (angular.isDate(val)) { - return val; - } - try { - val = val + ""; - format = format + ""; - if (!format.length) { - return new Date(val); - } - if (datetimeFormats[format]) { - format = datetimeFormats[format]; + }; + } ]).factory("$dateParser", [ "$locale", "dateParserHelpers", function($locale, dateParserHelpers) { + var datetimeFormats = $locale.DATETIME_FORMATS; + var monthNames = datetimeFormats.MONTH.concat(datetimeFormats.SHORTMONTH); + var dayNames = datetimeFormats.DAY.concat(datetimeFormats.SHORTDAY); + return function(val, format) { + if (angular.isDate(val)) { + return val; } - var now = new Date(), i_val = 0, i_format = 0, format_token = "", year = now.getFullYear(), month = now.getMonth() + 1, date = now.getDate(), hh = 0, mm = 0, ss = 0, sss = 0, ampm = "am", z = 0, parsedZ = false; - while (i_format < format.length) { - format_token = format.charAt(i_format); - var token = ""; - if (format.charAt(i_format) == "'") { - var _i_format = i_format; - while (format.charAt(++i_format) != "'" && i_format < format.length) { - token += format.charAt(i_format); - } - if (val.substring(i_val, i_val + token.length) != token) { - throw "Pattern value mismatch"; - } - i_val += token.length; - i_format++; - continue; + try { + val = val + ""; + format = format + ""; + if (!format.length) { + return new Date(val); } - while (format.charAt(i_format) == format_token && i_format < format.length) { - token += format.charAt(i_format++); + if (datetimeFormats[format]) { + format = datetimeFormats[format]; } - if (token == "yyyy" || token == "yy" || token == "y") { - var minLength, maxLength; - if (token == "yyyy") { - minLength = 4; - maxLength = 4; - } - if (token == "yy") { - minLength = 2; - maxLength = 2; - } - if (token == "y") { - minLength = 2; - maxLength = 4; + var now = new Date(), i_val = 0, i_format = 0, format_token = "", year = now.getFullYear(), month = now.getMonth() + 1, date = now.getDate(), hh = 0, mm = 0, ss = 0, sss = 0, ampm = "am", z = 0, parsedZ = false; + while (i_format < format.length) { + format_token = format.charAt(i_format); + var token = ""; + if (format.charAt(i_format) == "'") { + var _i_format = i_format; + while (format.charAt(++i_format) != "'" && i_format < format.length) { + token += format.charAt(i_format); + } + if (val.substring(i_val, i_val + token.length) != token) { + throw "Pattern value mismatch"; + } + i_val += token.length; + i_format++; + continue; } - year = dateParserHelpers.getInteger(val, i_val, minLength, maxLength); - if (year === null) { - throw "Invalid year"; + while (format.charAt(i_format) == format_token && i_format < format.length) { + token += format.charAt(i_format++); } - i_val += year.length; - if (year.length == 2) { - if (year > 70) { - year = 1900 + (year - 0); + if (token == "yyyy" || token == "yy" || token == "y") { + var minLength, maxLength; + if (token == "yyyy") { + minLength = 4; + maxLength = 4; + } + if (token == "yy") { + minLength = 2; + maxLength = 2; + } + if (token == "y") { + minLength = 2; + maxLength = 4; + } + year = dateParserHelpers.getInteger(val, i_val, minLength, maxLength); + if (year === null) { + throw "Invalid year"; + } + i_val += year.length; + if (year.length == 2) { + if (year > 70) { + year = 1900 + (year - 0); + } else { + year = 2e3 + (year - 0); + } + } + } else if (token === "MMMM" || token == "MMM") { + month = 0; + for (var i = 0; i < monthNames.length; i++) { + var month_name = monthNames[i]; + if (val.substring(i_val, i_val + month_name.length).toLowerCase() == month_name.toLowerCase()) { + month = i + 1; + if (month > 12) { + month -= 12; + } + i_val += month_name.length; + break; + } + } + if (month < 1 || month > 12) { + throw "Invalid month"; + } + } else if (token == "EEEE" || token == "EEE") { + for (var j = 0; j < dayNames.length; j++) { + var day_name = dayNames[j]; + if (val.substring(i_val, i_val + day_name.length).toLowerCase() == day_name.toLowerCase()) { + i_val += day_name.length; + break; + } + } + } else if (token == "MM" || token == "M") { + month = dateParserHelpers.getInteger(val, i_val, token.length, 2); + if (month === null || month < 1 || month > 12) { + throw "Invalid month"; + } + i_val += month.length; + } else if (token == "dd" || token == "d") { + date = dateParserHelpers.getInteger(val, i_val, token.length, 2); + if (date === null || date < 1 || date > 31) { + throw "Invalid date"; + } + i_val += date.length; + } else if (token == "HH" || token == "H") { + hh = dateParserHelpers.getInteger(val, i_val, token.length, 2); + if (hh === null || hh < 0 || hh > 23) { + throw "Invalid hours"; + } + i_val += hh.length; + } else if (token == "hh" || token == "h") { + hh = dateParserHelpers.getInteger(val, i_val, token.length, 2); + if (hh === null || hh < 1 || hh > 12) { + throw "Invalid hours"; + } + i_val += hh.length; + } else if (token == "mm" || token == "m") { + mm = dateParserHelpers.getInteger(val, i_val, token.length, 2); + if (mm === null || mm < 0 || mm > 59) { + throw "Invalid minutes"; + } + i_val += mm.length; + } else if (token == "ss" || token == "s") { + ss = dateParserHelpers.getInteger(val, i_val, token.length, 2); + if (ss === null || ss < 0 || ss > 59) { + throw "Invalid seconds"; + } + i_val += ss.length; + } else if (token === "sss") { + sss = dateParserHelpers.getInteger(val, i_val, 3, 3); + if (sss === null || sss < 0 || sss > 999) { + throw "Invalid milliseconds"; + } + i_val += 3; + } else if (token == "a") { + if (val.substring(i_val, i_val + 2).toLowerCase() == "am") { + ampm = "AM"; + } else if (val.substring(i_val, i_val + 2).toLowerCase() == "pm") { + ampm = "PM"; } else { - year = 2e3 + (year - 0); + throw "Invalid AM/PM"; } - } - } else if (token === "MMMM" || token == "MMM") { - month = 0; - for (var i = 0; i < monthNames.length; i++) { - var month_name = monthNames[i]; - if (val.substring(i_val, i_val + month_name.length).toLowerCase() == month_name.toLowerCase()) { - month = i + 1; - if (month > 12) { - month -= 12; + i_val += 2; + } else if (token == "Z") { + parsedZ = true; + if (val[i_val] === "Z") { + z = 0; + i_val += 1; + } else { + if (val[i_val + 3] === ":") { + var tzStr = val.substring(i_val, i_val + 6); + z = parseInt(tzStr.substr(0, 3), 10) * 60 + parseInt(tzStr.substr(4, 2), 10); + i_val += 6; + } else { + var tzStr = val.substring(i_val, i_val + 5); + z = parseInt(tzStr.substr(0, 3), 10) * 60 + parseInt(tzStr.substr(3, 2), 10); + i_val += 5; } - i_val += month_name.length; - break; } - } - if (month < 1 || month > 12) { - throw "Invalid month"; - } - } else if (token == "EEEE" || token == "EEE") { - for (var j = 0; j < dayNames.length; j++) { - var day_name = dayNames[j]; - if (val.substring(i_val, i_val + day_name.length).toLowerCase() == day_name.toLowerCase()) { - i_val += day_name.length; - break; + if (z > 720 || z < -720) { + throw "Invalid timezone"; } - } - } else if (token == "MM" || token == "M") { - month = dateParserHelpers.getInteger(val, i_val, token.length, 2); - if (month === null || month < 1 || month > 12) { - throw "Invalid month"; - } - i_val += month.length; - } else if (token == "dd" || token == "d") { - date = dateParserHelpers.getInteger(val, i_val, token.length, 2); - if (date === null || date < 1 || date > 31) { - throw "Invalid date"; - } - i_val += date.length; - } else if (token == "HH" || token == "H") { - hh = dateParserHelpers.getInteger(val, i_val, token.length, 2); - if (hh === null || hh < 0 || hh > 23) { - throw "Invalid hours"; - } - i_val += hh.length; - } else if (token == "hh" || token == "h") { - hh = dateParserHelpers.getInteger(val, i_val, token.length, 2); - if (hh === null || hh < 1 || hh > 12) { - throw "Invalid hours"; - } - i_val += hh.length; - } else if (token == "mm" || token == "m") { - mm = dateParserHelpers.getInteger(val, i_val, token.length, 2); - if (mm === null || mm < 0 || mm > 59) { - throw "Invalid minutes"; - } - i_val += mm.length; - } else if (token == "ss" || token == "s") { - ss = dateParserHelpers.getInteger(val, i_val, token.length, 2); - if (ss === null || ss < 0 || ss > 59) { - throw "Invalid seconds"; - } - i_val += ss.length; - } else if (token === "sss") { - sss = dateParserHelpers.getInteger(val, i_val, 3, 3); - if (sss === null || sss < 0 || sss > 999) { - throw "Invalid milliseconds"; - } - i_val += 3; - } else if (token == "a") { - if (val.substring(i_val, i_val + 2).toLowerCase() == "am") { - ampm = "AM"; - } else if (val.substring(i_val, i_val + 2).toLowerCase() == "pm") { - ampm = "PM"; } else { - throw "Invalid AM/PM"; - } - i_val += 2; - } else if (token == "Z") { - parsedZ = true; - if (val[i_val] === "Z") { - z = 0; - i_val += 1; - } else { - if (val[i_val + 3] === ":") { - var tzStr = val.substring(i_val, i_val + 6); - z = parseInt(tzStr.substr(0, 3), 10) * 60 + parseInt(tzStr.substr(4, 2), 10); - i_val += 6; + if (val.substring(i_val, i_val + token.length) != token) { + throw "Pattern value mismatch"; } else { - var tzStr = val.substring(i_val, i_val + 5); - z = parseInt(tzStr.substr(0, 3), 10) * 60 + parseInt(tzStr.substr(3, 2), 10); - i_val += 5; + i_val += token.length; } } - if (z > 720 || z < -720) { - throw "Invalid timezone"; - } - } else { - if (val.substring(i_val, i_val + token.length) != token) { - throw "Pattern value mismatch"; + } + if (i_val != val.length) { + throw "Pattern value mismatch"; + } + year = parseInt(year, 10); + month = parseInt(month, 10); + date = parseInt(date, 10); + hh = parseInt(hh, 10); + mm = parseInt(mm, 10); + ss = parseInt(ss, 10); + sss = parseInt(sss, 10); + if (month == 2) { + if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) { + if (date > 29) { + throw "Invalid date"; + } } else { - i_val += token.length; + if (date > 28) { + throw "Invalid date"; + } } } - } - if (i_val != val.length) { - throw "Pattern value mismatch"; - } - year = parseInt(year, 10); - month = parseInt(month, 10); - date = parseInt(date, 10); - hh = parseInt(hh, 10); - mm = parseInt(mm, 10); - ss = parseInt(ss, 10); - sss = parseInt(sss, 10); - if (month == 2) { - if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) { - if (date > 29) { - throw "Invalid date"; - } - } else { - if (date > 28) { + if (month == 4 || month == 6 || month == 9 || month == 11) { + if (date > 30) { throw "Invalid date"; } } - } - if (month == 4 || month == 6 || month == 9 || month == 11) { - if (date > 30) { - throw "Invalid date"; + if (hh < 12 && ampm == "PM") { + hh += 12; + } else if (hh > 11 && ampm == "AM") { + hh -= 12; } + var localDate = new Date(year, month - 1, date, hh, mm, ss, sss); + if (parsedZ) { + return new Date(localDate.getTime() - (z + localDate.getTimezoneOffset()) * 6e4); + } + return localDate; + } catch (e) { + return undefined; } - if (hh < 12 && ampm == "PM") { - hh += 12; - } else if (hh > 11 && ampm == "AM") { - hh -= 12; - } - var localDate = new Date(year, month - 1, date, hh, mm, ss, sss); - if (parsedZ) { - return new Date(localDate.getTime() - (z + localDate.getTimezoneOffset()) * 6e4); + }; + } ]); + angular.module("dateParser").directive("dateParser", [ "dateFilter", "$dateParser", function(dateFilter, $dateParser) { + return { + restrict: "A", + require: "ngModel", + link: function(scope, element, attrs, ngModel) { + var dateFormat; + attrs.$observe("dateParser", function(value) { + dateFormat = value; + ngModel.$render(); + }); + ngModel.$parsers.unshift(function(viewValue) { + var date = $dateParser(viewValue, dateFormat); + if (isNaN(date)) { + ngModel.$setValidity("date", false); + } else { + ngModel.$setValidity("date", true); + } + return date; + }); + ngModel.$render = function() { + element.val(ngModel.$modelValue ? dateFilter(ngModel.$modelValue, dateFormat) : undefined); + scope.ngModel = ngModel.$modelValue; + }; + ngModel.$formatters.push(function(modelValue) { + return modelValue ? dateFilter(modelValue, dateFormat) : ""; + }); } - return localDate; - } catch (e) { - return undefined; - } - }; -} ]); \ No newline at end of file + }; + } ]); +})(angular); \ No newline at end of file diff --git a/dist/angular-dateparser.min.js b/dist/angular-dateparser.min.js index a940f05..a878ec8 100644 --- a/dist/angular-dateparser.min.js +++ b/dist/angular-dateparser.min.js @@ -1,12 +1,3 @@ -/*! - * Angular DateParser 1.0.9 - * https://github.com/dnasir/angular-dateParser - * - * Copyright 2013, Dzulqarnain Nasir - * http://www.dnasir.com - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/MIT - */ -angular.module("dateParser",[]).factory("dateParserHelpers",[function(){"use strict";return{hasOnlyIntegers:function(a){if(!a)return!1;for(var b="1234567890",c=0;c=c;e--){var f=a.substring(b,b+e);if(this.hasOnlyIntegers(f))return f}return null}}}]).factory("$dateParser",["$locale","dateParserHelpers",function(a,b){"use strict";var c=a.DATETIME_FORMATS,d=c.MONTH.concat(c.SHORTMONTH),e=c.DAY.concat(c.SHORTDAY);return function(a,f){if(angular.isDate(a))return a;try{if(a+="",f+="",!f.length)return new Date(a);c[f]&&(f=c[f]);for(var g=new Date,h=0,i=0,j="",k=g.getFullYear(),l=g.getMonth()+1,m=g.getDate(),n=0,o=0,p=0,q=0,r="am",s=0,t=!1;i70?1900+(k-0):2e3+(k-0))}else if("MMMM"===u||"MMM"==u){l=0;for(var x=0;x12&&(l-=12),h+=y.length;break}}if(1>l||l>12)throw"Invalid month"}else if("EEEE"==u||"EEE"==u)for(var z=0;zl||l>12)throw"Invalid month";h+=l.length}else if("dd"==u||"d"==u){if(m=b.getInteger(a,h,u.length,2),null===m||1>m||m>31)throw"Invalid date";h+=m.length}else if("HH"==u||"H"==u){if(n=b.getInteger(a,h,u.length,2),null===n||0>n||n>23)throw"Invalid hours";h+=n.length}else if("hh"==u||"h"==u){if(n=b.getInteger(a,h,u.length,2),null===n||1>n||n>12)throw"Invalid hours";h+=n.length}else if("mm"==u||"m"==u){if(o=b.getInteger(a,h,u.length,2),null===o||0>o||o>59)throw"Invalid minutes";h+=o.length}else if("ss"==u||"s"==u){if(p=b.getInteger(a,h,u.length,2),null===p||0>p||p>59)throw"Invalid seconds";h+=p.length}else if("sss"===u){if(q=b.getInteger(a,h,3,3),null===q||0>q||q>999)throw"Invalid milliseconds";h+=3}else if("a"==u){if("am"==a.substring(h,h+2).toLowerCase())r="AM";else{if("pm"!=a.substring(h,h+2).toLowerCase())throw"Invalid AM/PM";r="PM"}h+=2}else if("Z"==u){if(t=!0,"Z"===a[h])s=0,h+=1;else if(":"===a[h+3]){var B=a.substring(h,h+6);s=60*parseInt(B.substr(0,3),10)+parseInt(B.substr(4,2),10),h+=6}else{var B=a.substring(h,h+5);s=60*parseInt(B.substr(0,3),10)+parseInt(B.substr(3,2),10),h+=5}if(s>720||-720>s)throw"Invalid timezone"}else{if(a.substring(h,h+u.length)!=u)throw"Pattern value mismatch";h+=u.length}}else{for(;"'"!=f.charAt(++i)&&i29)throw"Invalid date"}else if(m>28)throw"Invalid date";if((4==l||6==l||9==l||11==l)&&m>30)throw"Invalid date";12>n&&"PM"==r?n+=12:n>11&&"AM"==r&&(n-=12);var C=new Date(k,l-1,m,n,o,p,q);return t?new Date(C.getTime()-6e4*(s+C.getTimezoneOffset())):C}catch(D){return void 0}}}]); +/*! angular-dateParser 1.0.10 | (c) 2014, Dzulqarnain Nasir | MIT (http://www.opensource.org/licenses/MIT) */ +!function(a){a.module("dateParser",[]).factory("dateParserHelpers",[function(){var a={};return{getInteger:function(b,c,d,e){var f=b.substring(c),g=a[d+"_"+e];g||(g=new RegExp("^(\\d{"+d+","+e+"})"),a[d+"_"+e]=g);var h=g.exec(f);return h?h[1]:null}}}]).factory("$dateParser",["$locale","dateParserHelpers",function(b,c){var d=b.DATETIME_FORMATS,e=d.MONTH.concat(d.SHORTMONTH),f=d.DAY.concat(d.SHORTDAY);return function(b,g){if(a.isDate(b))return b;try{if(b+="",g+="",!g.length)return new Date(b);d[g]&&(g=d[g]);for(var h=new Date,i=0,j=0,k="",l=h.getFullYear(),m=h.getMonth()+1,n=h.getDate(),o=0,p=0,q=0,r=0,s="am",t=0,u=!1;j70?1900+(l-0):2e3+(l-0))}else if("MMMM"===v||"MMM"==v){m=0;for(var y=0;y12&&(m-=12),i+=z.length;break}}if(1>m||m>12)throw"Invalid month"}else if("EEEE"==v||"EEE"==v)for(var A=0;Am||m>12)throw"Invalid month";i+=m.length}else if("dd"==v||"d"==v){if(n=c.getInteger(b,i,v.length,2),null===n||1>n||n>31)throw"Invalid date";i+=n.length}else if("HH"==v||"H"==v){if(o=c.getInteger(b,i,v.length,2),null===o||0>o||o>23)throw"Invalid hours";i+=o.length}else if("hh"==v||"h"==v){if(o=c.getInteger(b,i,v.length,2),null===o||1>o||o>12)throw"Invalid hours";i+=o.length}else if("mm"==v||"m"==v){if(p=c.getInteger(b,i,v.length,2),null===p||0>p||p>59)throw"Invalid minutes";i+=p.length}else if("ss"==v||"s"==v){if(q=c.getInteger(b,i,v.length,2),null===q||0>q||q>59)throw"Invalid seconds";i+=q.length}else if("sss"===v){if(r=c.getInteger(b,i,3,3),null===r||0>r||r>999)throw"Invalid milliseconds";i+=3}else if("a"==v){if("am"==b.substring(i,i+2).toLowerCase())s="AM";else{if("pm"!=b.substring(i,i+2).toLowerCase())throw"Invalid AM/PM";s="PM"}i+=2}else if("Z"==v){if(u=!0,"Z"===b[i])t=0,i+=1;else if(":"===b[i+3]){var C=b.substring(i,i+6);t=60*parseInt(C.substr(0,3),10)+parseInt(C.substr(4,2),10),i+=6}else{var C=b.substring(i,i+5);t=60*parseInt(C.substr(0,3),10)+parseInt(C.substr(3,2),10),i+=5}if(t>720||-720>t)throw"Invalid timezone"}else{if(b.substring(i,i+v.length)!=v)throw"Pattern value mismatch";i+=v.length}}else{for(;"'"!=g.charAt(++j)&&j29)throw"Invalid date"}else if(n>28)throw"Invalid date";if((4==m||6==m||9==m||11==m)&&n>30)throw"Invalid date";12>o&&"PM"==s?o+=12:o>11&&"AM"==s&&(o-=12);var D=new Date(l,m-1,n,o,p,q,r);return u?new Date(D.getTime()-6e4*(t+D.getTimezoneOffset())):D}catch(E){return void 0}}}]),a.module("dateParser").directive("dateParser",["dateFilter","$dateParser",function(a,b){return{restrict:"A",require:"ngModel",link:function(c,d,e,f){var g;e.$observe("dateParser",function(a){g=a,f.$render()}),f.$parsers.unshift(function(a){var c=b(a,g);return isNaN(c)?f.$setValidity("date",!1):f.$setValidity("date",!0),c}),f.$render=function(){d.val(f.$modelValue?a(f.$modelValue,g):void 0),c.ngModel=f.$modelValue},f.$formatters.push(function(b){return b?a(b,g):""})}}}])}(angular); //# sourceMappingURL=angular-dateparser.min.js.map \ No newline at end of file diff --git a/dist/angular-dateparser.min.js.map b/dist/angular-dateparser.min.js.map index de20a00..c44eb18 100644 --- a/dist/angular-dateparser.min.js.map +++ b/dist/angular-dateparser.min.js.map @@ -1 +1 @@ -{"version":3,"file":"angular-dateparser.min.js","sources":["../dateparser.js"],"names":["angular","module","factory","hasOnlyIntegers","string","digits","i","length","indexOf","charAt","getInteger","startPoint","minLength","maxLength","extracted","substring","this","$locale","dateParserHelpers","datetimeFormats","DATETIME_FORMATS","monthNames","MONTH","concat","SHORTMONTH","dayNames","DAY","SHORTDAY","val","format","isDate","Date","now","i_val","i_format","format_token","year","getFullYear","month","getMonth","date","getDate","hh","mm","ss","sss","ampm","z","parsedZ","token","month_name","toLowerCase","j","day_name","tzStr","parseInt","substr","localDate","getTime","getTimezoneOffset","e","undefined"],"m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V,IAAIA,EAAO,GACP,KAAM,cAKlB,KAAc,GAATF,GAAyB,GAATA,GAAyB,GAATA,GAAyB,IAATA,IAC7CE,EAAO,GACP,KAAM,cAKL,IAALE,GAAmB,MAARI,EACXJ,GAAM,GACCA,EAAK,IAAc,MAARI,IAClBJ,GAAM,GAGV,IAAIe,GAAY,GAAI1B,MAAKK,EAAME,EAAQ,EAAGE,EAAME,EAAIC,EAAIC,EAAIC,EAE5D,OAAIG,GACO,GAAIjB,MAAK0B,EAAUC,UAAkD,KAArCX,EAAIU,EAAUE,sBAGlDF,EACT,MAAMG,GACJ,MAAOC"} \ No newline at end of file +{"version":3,"file":"angular-dateparser.min.js","sources":["angular-dateparser.js"],"names":["angular","module","factory","cache","getInteger","string","startPoint","minLength","maxLength","val","substring","matcher","RegExp","match","exec","$locale","dateParserHelpers","datetimeFormats","DATETIME_FORMATS","monthNames","MONTH","concat","SHORTMONTH","dayNames","DAY","SHORTDAY","format","isDate","length","Date","now","i_val","i_format","format_token","year","getFullYear","month","getMonth","date","getDate","hh","mm","ss","sss","ampm","z","parsedZ","charAt","token","i","month_name","toLowerCase","j","day_name","tzStr","parseInt","substr","localDate","getTime","getTimezoneOffset","e","undefined","directive","dateFilter","$dateParser","restrict","require","link","scope","element","attrs","ngModel","dateFormat","$observe","value","$render","$parsers","unshift","viewValue","isNaN","$setValidity","$modelValue","$formatters","push","modelValue"],"mappings":";CAOA,SAAUA,GACNA,EAAQC,OAAO,iBAAkBC,QAAQ,qBAAuB,WAC5D,GAAIC,KACJ,QACIC,WAAY,SAASC,EAAQC,EAAYC,EAAWC,GAChD,GAAIC,GAAMJ,EAAOK,UAAUJ,GACvBK,EAAUR,EAAMI,EAAY,IAAMC,EACjCG,KACDA,EAAU,GAAIC,QAAO,SAAWL,EAAY,IAAMC,EAAY,MAC9DL,EAAMI,EAAY,IAAMC,GAAaG,EAEzC,IAAIE,GAAQF,EAAQG,KAAKL,EACzB,OAAII,GACOA,EAAM,GAEV,UAGdX,QAA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MG,SAAS,aAAc,SAASC,GAClCF,EAAaE,EACbH,EAAQI,YAEZJ,EAAQK,SAASC,QAAQ,SAASC,GAC9B,GAAIxC,GAAO0B,EAAYc,EAAWN,EAMlC,OALIO,OAAMzC,GACNiC,EAAQS,aAAa,QAAQ,GAE7BT,EAAQS,aAAa,QAAQ,GAE1B1C,IAEXiC,EAAQI,QAAU,WACdN,EAAQ5D,IAAI8D,EAAQU,YAAclB,EAAWQ,EAAQU,YAAaT,GAAcX,QAChFO,EAAMG,QAAUA,EAAQU,aAE5BV,EAAQW,YAAYC,KAAK,SAASC,GAC9B,MAAOA,GAAarB,EAAWqB,EAAYZ,GAAc,WAK1ExE"} \ No newline at end of file diff --git a/package.json b/package.json index 58f7385..3a9af89 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "author": "Dzulqarnain Nasir", "name": "angular-dateParser", - "version": "1.0.9", + "version": "1.0.10", "homepage": "https://github.com/dnasir/angular-dateParser", "licenses": { "type": "MIT", - "url": "https://raw.github.com/joshdmiller/ng-boilerplate/master/LICENSE" + "url": "http://www.opensource.org/licenses/MIT" }, "bugs": "https://github.com/dnasir/angular-dateParser/issues", "repository": { diff --git a/test/dateparser.directive.spec.js b/test/dateparser.directive.spec.js index 95f2c4d..d85c037 100644 --- a/test/dateparser.directive.spec.js +++ b/test/dateparser.directive.spec.js @@ -1,7 +1,7 @@ -describe('dateParserDirective', function() { +describe('dateParser directive', function() { var $scope, $compile; - beforeEach(module('dateParserDirective')); + beforeEach(module('dateParser')); beforeEach(inject(function(_$rootScope_, _$compile_) { $scope = _$rootScope_;