diff --git a/README.md b/README.md
index 229de9e..50f34b0 100644
--- a/README.md
+++ b/README.md
@@ -91,6 +91,13 @@ format | String | 'YYYY/MM/DD hh:mm' | Any combination of YYYY, YY, MM, DD, hh,
multiple | Boolean | true | Whether user can change calendar type or not
autoClose | Boolean | false | Closing ADMdtp on selecting a day
transition | Boolean | true | Transition on loading days
+placeholder | String | '' | Adds datepicker placeholder
+hideTimeSelector | Boolean | false | Hides time button from calendar dropbox
+startsOnMonday | Boolean | false | Sets if the calendar starts on monday
+daysNames | Array | An array of strings with week days starting from Sunday
+monthsNames | Array | An array of month names starting from January
+todayStr | String | Translation string for today button
+gregorianStr | String | Translation string for Gregorian button
---
### Custom input template
You can put custom input template inside `` but with unwanted limits.
@@ -137,6 +144,9 @@ putting **Exclamation mark (!)** at the begining of the pattern will inverse dis
patterns of the same type can be combine with **Ampersand (&)**.
mention that `['2d+1', '7d']` and `['2d+1&7d']` are equal, but `['!2d+1', '!7d']` and `['!2d+1&7d']` are completely differents.
+#### Hide time selector
+Hide time selector from calendar by adding `hideTimeSelector` in your options.
+
##### Smart disabling:
`i` in Gregorian calendar will disable Sundays (weekend) that is equal to Fridays (weekend) in Jalali calendar.
option `smartDisabling: true` change Sunday from Gregorian calendar to Friday in Jalali calendar by switching calendar type,
@@ -211,3 +221,21 @@ No need to destroy datepickers anymore!
```
+
+#### Translation
+Just add `daysNames`, `monthsNames`, `todayStr` and/or `gregorianStr` in the options that you are passing to the directive. If none are provided it will fall back to the default ones.
+
+```html
+
+```
+
+```javascript
+app.controller('MainController', function ($scope) {
+ $scope.datepickerOptions = {
+ daysNames: ['Нед', 'Пон', 'Вто', 'Сре', 'Чет', 'Пет', 'Саб'],
+ monthsNames: ['Јан', 'Феб', 'Мар', 'Апр', 'Мај', 'Јун', 'Јул', 'Авг', 'Септ', 'Окт', 'Ное', 'Дек'],
+ todayStr: 'Денес',
+ gregorianStr: 'Грегоријански'
+ }
+});
+```
\ No newline at end of file
diff --git a/bower.json b/bower.json
index 11e829e..16370aa 100644
--- a/bower.json
+++ b/bower.json
@@ -6,7 +6,10 @@
"ADM | Amirkabir Data Miners "
],
"description": "Pure AngularJs Gregorian and Jalali smart dateTimePicker",
- "main": "ADM-dateTimePicker.js",
+ "main": [
+ "dist/ADM-dateTimePicker.min.js",
+ "dist/ADM-dateTimePicker.min.css"
+ ],
"moduleType": [
"globals"
],
diff --git a/dist/ADM-dateTimePicker.js b/dist/ADM-dateTimePicker.js
index fa71527..af7a9a0 100644
--- a/dist/ADM-dateTimePicker.js
+++ b/dist/ADM-dateTimePicker.js
@@ -945,8 +945,13 @@
scope.calTypeChanged = function() {
scope.calType = (scope.calType=='gregorian')?'jalali':'gregorian';
- scope.monthNames = constants.calendars[scope.calType].monthsNames;
- scope.daysNames = constants.calendars[scope.calType].daysNames;
+ scope.monthNames = scope.option.monthsNames || constants.calendars[scope.calType].monthsNames;
+ scope.daysNames = scope.option.daysNames || constants.calendars[scope.calType].daysNames;
+
+ if (scope.option.startsOnMonday) {
+ var sunDay = scope.daysNames.shift();
+ scope.daysNames.push(sunDay);
+ }
var _cur = angular.copy(scope.current);
var _mainDate;
@@ -967,10 +972,19 @@
}
-
+ scope.todayStr = (scope.calType=="jalali") ? "امروز" : "Today";
+ scope.gregorianStr = 'Gregorian';
+
+ if (scope.option.todayStr) {
+ scope.todayStr = scope.option.todayStr;
+ }
+
+ if (scope.option.gregorianStr) {
+ scope.gregorianStr = scope.option.gregorianStr;
+ }
},
//templateUrl: 'js/ADM-dateTimePicker/ADM-dateTimePicker_calendar.html'
- template: '
'}},l=function(e){return{restrict:"A",scope:{clickOut:"&"},link:function(t,a,n){var r=void 0!==n.outsideIfNot?n.outsideIfNot.replace(", ",",").split(","):[];void 0==n.id&&n.$set("id","id_"+Math.random()),void 0!==n.id&&r.push(n.id),e.on("click contextmenu",function(e){var a,n=0;if(e.target){for(a=e.target;a;a=a.parentNode){var i=a.id,o=a.className;if(void 0!==i)for(n=0;n-1||"string"==typeof o&&o.indexOf(r[n])>-1)return}t.$eval(t.clickOut)}})}}},s=function(e){try{document.createEvent("TouchEvent"),e.setOptions({isDeviceTouch:!0})}catch(t){e.setOptions({isDeviceTouch:!1})}};return e.module("ADM-dateTimePicker",[]).constant("constants",{calendars:{gregorian:{monthsNames:["January","February","March","April","May","June","July","August","September","October","November","December"],daysNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},jalali:{monthsNames:["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],daysNames:["ش","ی","د","س","چ","پ","ج"]}}}).provider("ADMdtp",t).filter("digitType",[a]).factory("ADMdtpConvertor",[n]).factory("ADMdtpFactory",["ADMdtpConvertor",r]).directive("admDtp",["ADMdtp","ADMdtpConvertor","ADMdtpFactory","constants","$compile","$timeout",o]).directive("admDtpCalendar",["ADMdtp","ADMdtpConvertor","ADMdtpFactory","constants","$timeout",i]).directive("clickOut",["$document",l]).config(["ADMdtpProvider",s])}(window.angular);
\ No newline at end of file