Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Introduce possibility to get a particular renderer #124

Closed
wants to merge 1 commit into from

2 participants

@afoeder

Analogously to the Picker.Date.defineRenderer function, a new one
is introduced to get a defined renderer, Picker.Date.getRenderer.
This allows one to modify/augment present renderers without replacing
the whole method.

@afoeder afoeder [FEATURE] Add possibility for retrieving renderer
Analogously to the `Picker.Date.defineRenderer` function, a new one
is introduced to get a defined renderer, `Picker.Date.getRenderer`.
This allows one to modify/augment present renderers without replacing
the whole method.
ad85751
@arian
Owner

merged.

@arian arian closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 5, 2012
  1. @afoeder

    [FEATURE] Add possibility for retrieving renderer

    afoeder authored
    Analogously to the `Picker.Date.defineRenderer` function, a new one
    is introduced to get a defined renderer, `Picker.Date.getRenderer`.
    This allows one to modify/augment present renderers without replacing
    the whole method.
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 Source/Picker.Date.js
View
6 Source/Picker.Date.js
@@ -195,7 +195,7 @@ this.DatePicker = Picker.Date = new Class({
// start neatly at interval (eg. 1980 instead of 1987)
date = date.clone().decrement('year', date.get('year') % perPage);
-
+
var iterateDate = date.clone().decrement('year', Math.floor((pages - 1) / 2) * perPage);
for (var i = pages; i--;){
@@ -598,6 +598,10 @@ Picker.Date.defineRenderer = function(name, fn){
return this;
};
+Picker.Date.getRenderer = function(name) {
+ return renderers[name];
+}
+
var limitDate = function(date, min, max){
if (min && date < min) return min;
if (max && date > max) return max;
Something went wrong with that request. Please try again.