From 086049cfed5847788b26be8ec40a1ac6f86b6894 Mon Sep 17 00:00:00 2001 From: Kevin Strasters Date: Fri, 19 May 2017 14:10:59 -0500 Subject: [PATCH] add global config for perLine --- README.md | 6 ++++++ dist/angular-moment-picker.js | 20 +++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e631ce6..afca4c8 100644 --- a/README.md +++ b/README.md @@ -180,19 +180,25 @@ left-arrow | `"←"` | Left arrow string (HTML allowed). right-arrow | `"→"` | Right arrow string (HTML allowed). additions | `{ top: undefined, bottom: undefined }` | Template url for custom contents above and below each picker views (inside the dialog). years-format | `"YYYY"` | Years format in `decade` view. +years-perLine | `4` | Years per line in `decade` view. months-format | `"MMM"` | Months format in `year` view. +months-perLine | `4` | Months per line in `year` view. days-format | `"D"` | Days format in `month` view. +days-perLine | `moment.weekdays().length` | Days per line in `month` view. hours-format | `"HH:[00]"` | Hours format in `day` view. hours-start | `0` | First rendered hour in `day` view (24h format). hours-end | `23` | Last rendered hour in `day` view (24h format). +hours-perLine | `4` | Hours per line in `day` view. minutes-format | 2 | Minutes format in `hour` view. minutes-step | `5` | Step between each visible minute in `hour` view. minutes-start | `0` | First rendered minute in `hour` view. minutes-end | `59` | Last rendered minute in `hour` view. +minutes-perLine | `4` | Minutes per line in `hour` view. seconds-format | `"ss"` | Seconds format in `minute` view. seconds-step | `1` | Step between each visible second in `minute` view. seconds-start | `0` | First rendered second in `minute` view. seconds-end | `59` | Last rendered second in `minute` view. +seconds-perLine | `6` | Seconds per line in `minute` view. ## Notes diff --git a/dist/angular-moment-picker.js b/dist/angular-moment-picker.js index 1c702c9..c5ea0a4 100644 --- a/dist/angular-moment-picker.js +++ b/dist/angular-moment-picker.js @@ -715,23 +715,29 @@ var Provider = (function () { rightArrow: '→', // Decade View yearsFormat: 'YYYY', + yearsPerLine: 4, // Year View monthsFormat: 'MMM', + monthsPerLine: 4, // Month View daysFormat: 'D', + daysPerLine: moment.weekdays().length, // Day View hoursFormat: 'HH:[00]', hoursStart: 0, hoursEnd: 23, + hoursPerLine: 4, // Hour View minutesStep: 5, minutesStart: 0, minutesEnd: 59, + minutesPerLine: 4, // Minute View secondsFormat: 'ss', secondsStep: 1, secondsStart: 0, - secondsEnd: 59 + secondsEnd: 59, + secondsPerLine: 6 }; } Provider.prototype.options = function (options) { @@ -759,7 +765,7 @@ var DayView = (function () { this.$scope = $scope; this.$ctrl = $ctrl; this.provider = provider; - this.perLine = 4; + this.perLine = provider.hoursPerLine; this.rows = {}; } DayView.prototype.render = function () { @@ -812,7 +818,7 @@ var DecadeView = (function () { this.$scope = $scope; this.$ctrl = $ctrl; this.provider = provider; - this.perLine = 4; + this.perLine = provider.yearsPerLine; this.rows = {}; } DecadeView.prototype.render = function () { @@ -865,7 +871,7 @@ var HourView = (function () { this.$scope = $scope; this.$ctrl = $ctrl; this.provider = provider; - this.perLine = 4; + this.perLine = provider.minutesPerLine; this.rows = {}; } HourView.prototype.render = function () { @@ -963,7 +969,7 @@ var MinuteView = (function () { this.$scope = $scope; this.$ctrl = $ctrl; this.provider = provider; - this.perLine = 6; + this.perLine = provider.secondsPerLine; this.rows = {}; } MinuteView.prototype.render = function () { @@ -1042,7 +1048,7 @@ var MonthView = (function () { this.$scope = $scope; this.$ctrl = $ctrl; this.provider = provider; - this.perLine = moment.weekdays().length; + this.perLine = provider.daysPerLine; this.rows = []; } MonthView.prototype.render = function () { @@ -1101,7 +1107,7 @@ var YearView = (function () { this.$scope = $scope; this.$ctrl = $ctrl; this.provider = provider; - this.perLine = 4; + this.perLine = provider.monthsPerLine; this.rows = {}; } YearView.prototype.render = function () {