JAVASCRIPT   7

picker.date.js

Guest on 20th July 2021 03:35:18 PM

  1. /*!
  2.  * Date picker for pickadate.js v3.5.6
  3.  * http://amsul.github.io/pickadate.js/date.htm
  4.  */
  5.  
  6. (function ( factory ) {
  7.  
  8.     // AMD.
  9.     if ( typeof define == 'function' && define.amd )
  10.         define( ['picker', 'jquery'], factory )
  11.  
  12.     // Node.js/browserify.
  13.     else if ( typeof exports == 'object' )
  14.         module.exports = factory( require('./picker.js'), require('jquery') )
  15.  
  16.     // Browser globals.
  17.     else factory( Picker, jQuery )
  18.  
  19. }(function( Picker, $ ) {
  20.  
  21.  
  22. /**
  23.  * Globals and constants
  24.  */
  25. var DAYS_IN_WEEK = 7,
  26.     WEEKS_IN_CALENDAR = 6,
  27.     _ = Picker._
  28.  
  29.  
  30.  
  31. /**
  32.  * The date picker constructor
  33.  */
  34. function DatePicker( picker, settings ) {
  35.  
  36.     var calendar = this,
  37.         element = picker.$node[ 0 ],
  38.         elementValue = element.value,
  39.         elementDataValue = picker.$node.data( 'value' ),
  40.         valueString = elementDataValue || elementValue,
  41.         formatString = elementDataValue ? settings.formatSubmit : settings.format,
  42.         isRTL = function() {
  43.  
  44.             return element.currentStyle ?
  45.  
  46.                 // For IE.
  47.                 element.currentStyle.direction == 'rtl' :
  48.  
  49.                 // For normal browsers.
  50.                 getComputedStyle( picker.$root[0] ).direction == 'rtl'
  51.         }
  52.  
  53.     calendar.settings = settings
  54.     calendar.$node = picker.$node
  55.  
  56.     // The queue of methods that will be used to build item objects.
  57.     calendar.queue = {
  58.         min: 'measure create',
  59.         max: 'measure create',
  60.         now: 'now create',
  61.         select: 'parse create validate',
  62.         highlight: 'parse navigate create validate',
  63.         view: 'parse create validate viewset',
  64.         disable: 'deactivate',
  65.         enable: 'activate'
  66.     }
  67.  
  68.     // The component's item object.
  69.     calendar.item = {}
  70.  
  71.     calendar.item.clear = null
  72.     calendar.item.disable = ( settings.disable || [] ).slice( 0 )
  73.     calendar.item.enable = -(function( collectionDisabled ) {
  74.         return collectionDisabled[ 0 ] === true ? collectionDisabled.shift() : -1
  75.     })( calendar.item.disable )
  76.  
  77.     calendar.
  78.         set( 'min', settings.min ).
  79.         set( 'max', settings.max ).
  80.         set( 'now' )
  81.  
  82.     // When there’s a value, set the `select`, which in turn
  83. turn// also sets the `highlight` and `view`.
  84. ew`.
  85.     if ( valueString ) {
  86.         calendar.set( 'select', valueString, {
  87.             format: formatString,
  88.             defaultValue: true
  89.         })
  90.     }
  91. // If there’s no value, default to highlighting “today”.
  92. œtoday”.
  93.     else {
  94.         calendar.
  95.             set( 'select', null ).
  96.             set( 'highlight', calendar.item.// The keycode to movement mapping.
  97. movement mapping.
  98.     calendar.key =// Down
  99.    40: 7, // Dow// Up
  100.     38: -7, // Up
  101.         39: function() { return is// Right
  102. 1 : 1 }, // Right
  103.         37: function() { return is// Left
  104. 1 : -1 }, // Left
  105.         go: function( timeChange ) {
  106.             var highlightedObject = calendar.item.highlight,
  107.                 targetDate = new Date( highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange )
  108.             calendar.set(
  109.                 'highlight',
  110.                 targetDate,
  111.                 { interval: timeChange }
  112.             )
  113.             this.render()
  114.     // Bind some picker events.
  115. me picker events.
  116.     picker.
  117.         on( 'render', function() {
  118.             picker.$root.find( '.' + settings.klass.selectMonth ).on( 'change', function() {
  119.                 var value = this.value
  120.                 if ( value ) {
  121.                     picker.set( 'highlight', [ picker.get( 'view' ).year, value, picker.get( 'highlight' ).date ] )
  122.                     picker.$root.find( '.' + settings.klass.selectMonth ).trigger( 'focus' )
  123.                 }
  124.             })
  125.             picker.$root.find( '.' + settings.klass.selectYear ).on( 'change', function() {
  126.                 var value = this.value
  127.                 if ( value ) {
  128.                     picker.set( 'highlight', [ value, picker.get( 'view' ).month, picker.get( 'highlight' ).date ] )
  129.                     picker.$root.find( '.' + settings.klass.selectYear ).trigger( 'focus' )
  130.                 }
  131.             })
  132.         }, 1 ).
  133.         on( 'open', function() {
  134.             var includeToday = ''
  135.             if ( calendar.disabled( calendar.get('now') ) ) {
  136.                 includeToday = ':not(.' + settings.klass.buttonToday + ')'
  137.             }
  138.             picker.$root.find( 'button' + includeToday + ', select' ).attr( 'disabled', false )
  139.         }, 1 ).
  140.         on( 'close', function() {
  141.             picker.$root.find( 'button, select' ).attr( 'disabled', true )
  142. //DatePicker
  143. )
  144. /**
  145.  * Set a datepicker item object.
  146.  */r item object.
  147.  */
  148. DatePicker.prototype.set = function( type, value, options ) {
  149.  
  150.     var calendar = this,
  151.         calendarItem = c// If the value is `null` just set it immediately.
  152. t it immediately.
  153.     if ( value === null ) {
  154.         if ( type == 'clear'
  155.        calendarItem[ type ] = value
  156.        return calendar
  157.    }
  158.  
  159.    // Otherwise go through the queue of methods, and invoke the functions.
  160.    // Update this as the time unit, and set the final value as this item.
  161.    // * In the case of `enable`, keep the queue but set `disable` instead.
  162.    //   And in the case of `flip`, keep the queue but set `enable` instead.
  163.    calendarItem[ ( type == 'rItem[ ( type == 'enable' ? 'disable' : type == 'flip' ? 'enable' : type ) ] = calendar.queue[ type ].split( ' ' ).map( function( method ) {
  164.         value = calendar[ method ]( type, value, options )
  165.         return value
  166. // Check if we need to cascade through more updates.
  167. ugh more updates.
  168.     if ( type == 'select' ) {
  169.         calendar.set( 'highlight', calendarItem.select, options )
  170.     }
  171.     else if ( type == 'highlight' ) {
  172.         calendar.set( 'view', calendarItem.highlight, options )
  173.     }
  174.     else if ( type.match( sable|enable)$/ ) ) {
  175.         if ) ) {
  176.         if ( calendarItem.select && calendar.disabled( calendarItem.select ) ) {
  177.             calendar.set( 'select', calendarItem.select, options )
  178.         }
  179.         if ( calendarItem.highlight && calendar.disabled( calendarItem.highlight ) ) {
  180.             calendar.set( 'highlight', calendarItem.highlight, options )
  181.         }
  182.     }
  183.  
  184.     //DatePicker.prototype.set
  185. ke/**
  186.  * Get a datepicker item object.
  187.  */r item object.
  188.  */
  189. DatePicker.prototype.get = function( type ) {
  190.     return th//DatePicker.prototype.get
  191. ke/**
  192.  * Create a picker date object.
  193.  */r date object.
  194.  */
  195. DatePicker.prototype.create = function( type, value, options ) {
  196.  
  197.     var isInfiniteValue,
  198.         cal// If there’s no value, use the type as the value.
  199. the type as the value.
  200.     value = value === undefine// If it’s infinity, update the value.
  201. infinity, update the value.
  202.     if ( value == -Infinity || value == Infinity ) {
  203.         isInfin// If it’s an object, use the native date object.
  204. ect, use the native date object.
  205.     else if ( $.isPlainObject( value ) && _.isInteger( value.pick ) ) {
  206.     // If it’s an array, convert it into a date and make sure
  207.  con// that it’s a valid date – otherwise default to today.
  208. valid date – otherwise default to today.
  209.     else if ( $.isArray( value ) ) {
  210.         value = new Date( value[ 0 ], value[ 1 ], value[ 2 ] )
  211.         value = _.isDate( val// If it’s a number or date object, make a normalized date.
  212. s a number or date object, make a normalized date.
  213.     else if ( _.isInteger( value ) || _.isDate( value ) ) {
  214.         value = calenda// If it’s a literal true or any other case, set it to now.
  215. €™s /*if ( value === true )*/er case, set it to now.
  216.     else /*if ( value === true )*/ {
  217.       // Return the compiled object.
  218. alue, options )
  219.     }
  220.  
  221.     // Return the compiled object.
  222.     return {
  223.         year: isInfiniteValue || value.getFullYear(),
  224.         month: isInfiniteValue || value.getMonth(),
  225.         date: isInfiniteValue || value.getDate(),
  226.         day: isInfiniteValue || value.getDay(),
  227.         obj: isInfiniteValue || value,//DatePicker.prototype.create
  228.  |/**
  229.  * Create a range limit object using an array, date object,
  230.  * literal “true”, or integer relative to another time.
  231.  */teral “true”, or integer relative to another time.
  232.  */
  233. DatePicker.prototype.createRange = function( from, to ) {
  234.  
  235.     var calendar = this,
  236.         createDate = function( date ) {
  237.             if ( date === true || $.isArray( date ) || _.isDate( date ) ) {
  238.                 return calendar.cr// Create objects if possible.
  239.         return date
  240.         }
  241.  
  242.     // Create objects if possible.
  243.     if ( !_.isInteger( from ) ) {
  244.         from = createDate( from )
  245.     }
  246.     if // Create relative dates.
  247.        to = createDate( to )
  248.     }
  249.  
  250.     // Create relative dates.
  251.     if ( _.isInteger( from ) && $.isPlainObject( to ) ) {
  252.         from = [ to.year, to.month, to.date + from ];
  253.     }
  254.     else if ( _.isInteger( to ) && $.isPlainObject( from ) ) {
  255.         to = [ from.year, from.month, from.date + to ];
  256.     }
  257.  
  258.     return {
  259.      //DatePicker.prototype.createRange
  260.   /**
  261.  * Check if a date unit falls within a date range object.
  262.  */
  263. /**
  264.  * Check if a date unit falls within a date range object.
  265.  */
  266. DatePicker.prototype.withinRange = function( range, dateUnit ) {
  267.     range = this.createRange(range.from, range.to)
  268.     return dateU/**
  269.  * Check if two date range objects overlap.
  270.  */ge.to.pick
  271. }
  272.  
  273.  
  274. /**
  275.  * Check if two date range objects overlap.
  276.  */
  277. DatePicker.prototype.ove// Convert the ranges into comparable dates.
  278. calendar = this
  279.  
  280.     // Convert the ranges into comparable dates.
  281.     one = calendar.createRange( one.from, one.to )
  282.     two = calendar.createRange( two.from, two.to )
  283.  
  284.     return calendar.withinRange( one, two.from ) || calendar.withinRange( one, two.to ) ||
  285.         calendar.within/**
  286.  * Get the date today.
  287.  */ndar.withinRange( two, one.to )
  288. }
  289.  
  290.  
  291. /**
  292.  * Get the date today.
  293.  */
  294. DatePicker.prototype.now = function( type, value, options ) {
  295.     value = new Date()
  296.     if ( options && options.rel ) {
  297.         value.setDate( value.getDate() + op/**
  298.  * Navigate to next/prev month.
  299.  */lize( value, options )
  300. }
  301.  
  302.  
  303. /**
  304.  * Navigate to next/prev month.
  305.  */
  306. DatePicker.prototype.navigate = function( type, value, options ) {
  307.  
  308.     var targetDateObject,
  309.         targetYear,
  310.         targetMonth,
  311.         targetDate,
  312.         isTargetArray = $.isArray( value ),
  313.         isTargetObject /*,
  314.         safety = 100*/,
  315.         viewsetObject = this.item.view/*,
  316.         safety = 100*/
  317.  
  318.  
  319.     if ( isTargetArray || isTargetObject ) {
  320.  
  321.         if ( isTargetObject ) {
  322.             targetYear = value.year
  323.             targetMonth = value.month
  324.             targetDate = value.date
  325.         }
  326.         else {
  327.             targetYear = +value[0]
  328.             targetMonth // If we’re navigating months but the view is in a different
  329.    // If// month, navigate to the view’s year and month.
  330. a different
  331.         // month, navigate to the view’s year and month.
  332.         if ( options && options.nav && viewsetObject && viewsetObject.month !== targetMonth ) {
  333.             targetYear = viewsetO// Figure out the expected target year and month.
  334. .month
  335.         }
  336.  
  337.         // Figure out the expected target year and month.
  338.         targetDateObject = new Date( targetYear, targetMonth + ( options && options.nav ? options.nav : 0 ), 1 )
  339.         targetYear = targetDateObje// If the month we’re going to doesn’t have enough days,
  340. nth()
  341.  
  342.  // keep decreasing the date until we reach the month’s last date.
  343. ugh days,
  344.       /*safety &&*/reasing the date until we reach the month’s last date.
  345.         while ( /*safety &&*/ new Date( targetYear, target/*safety -= 1
  346.             if ( !safety ) {
  347.                 throw 'Fell into an infinite loop while navigating to ' + new Date( targetYear, targetMonth, targetDate ) + '.'
  348.             }*/ile navigating to ' + new Date( targetYear, targetMonth, targetDate ) + '.'
  349.             }*/
  350.   //DatePicker.prototype.navigate
  351. tY/**
  352.  * Normalize a date by setting the hours to midnight.
  353.  */tePicker.prototype.navigate
  354.  
  355.  
  356. /**
  357.  * Normalize a /*, options*/ng the hours to midnight.
  358.  */
  359. DatePicker.prototype.normaliz/**
  360.  * Measure the range of dates.
  361.  */   value.setHours( 0, 0, 0, 0 )
  362.     return value
  363. }
  364.  
  365.  
  366. /*, options*/e the range of dates.
  367.  */
  368. DatePicke// If it’s anything false-y, remove the limits.
  369. ions*/ ) {
  370.  
  371.     var calendar = this
  372.  
  373.     // If it’s anything false-y, remove // If it’s a string, parse it.
  374.        value = type == 'min' ? -Infinity : Infinity
  375.     }
  376.  
  377.     // If it’s a string, parse it.// If it's an integer, get a date relative to today.
  378. alue = calendar.parse( type, value )
  379.     }
  380.  
  381.     // If it's an integer, get a date relative to today.
  382.     else if ( _.isIntege///DatePicker.prototype.measure
  383. al/**
  384.  * Create a viewset object based on navigation.
  385.  */urn value
  386. } ///DatePicker.prototype.measure
  387.  
  388.  
  389. /**
  390.  * Creat/*, options*/bject based on navigation.
  391.  */
  392. DatePicker.prototype.viewset = function( ty/**
  393.  * Validate a date as enabled and shift if needed.
  394.  */ateObject.year, dateObject.month, 1 ])
  395. }
  396.  
  397.  
  398. /**
  399.  * Validate a date as enabled and shift if needed.
  400.  */
  401. DatePi// Keep a reference to the original date.
  402. dateObject, options ) {
  403.  
  404.     var calendar = this,
  405. // Make sure we have an interval.
  406. e original date.
  407.         originalDateObject = dateObject,
  408.  
  409.         // Make sure // Check if the calendar enabled dates are inverted.
  410. tions.interval ? options.interval : 1,
  411.  
  412.         // Check if th// Check if we have any enabled dates after/before now.
  413. Base = calendar.item.enable === -1,
  414.  
  415.         // Check if we have// The min & max limits.
  416. before now.
  417.         hasEnabledBeforeTarget, hasEnabledAfterTarget,
  418.  
  419.         // The min & max limi// Check if we’ve reached the limit during shifting.
  420.  maxLimitObject = calendar.item.max,
  421.  
  422.    // Check if the calendar is inverted and at least one weekday is enabled.
  423. eachedMin, reachedMax,
  424.  
  425.         // Check if the calendar is inverted and at least one weekday is enabled.
  426.    // If there’s a date, check where it is relative to the target.
  427. ilter( function( value ) {
  428.  
  429.             // If there’s a date, check where it is relative to the target.
  430.             if ( $.isArray( value ) ) {
  431.                 var dateTime = calendar.create( value ).pick
  432.                 if ( dateTime < dateObject.pick ) hasEnabledBeforeTarget = true
  433. // Return only integers for enabled weekdays.
  434. t.pick ) hasEnabledAfterTarget = true
  435.             }
  436.  
  437.     /*,
  438.  
  439.         safety = 100*/gers for// Cases to validate for:
  440.     // [1] Not inverted and date disabled.
  441. .len// [2] Inverted and some dates enabled.
  442.  Cas// [3] Not inverted and out of range.
  443. erte//
  444. nd d// Cases to **not** validate for:
  445. and // • Navigating months.
  446.  [3]// • Not inverted and date enabled.
  447.  
  448.    // • Inverted and all dates disabled.
  449. / â// • ..and anything else.
  450.  // • Not inverted and date enabled.
  451.     // • Inverted and all d/* 1 */sabled.
  452.     // • ..and anything else.
  453.     if ( !options || (/* 2 */s.nav && !options.defaultValue) ) if (
  454.         /* 1 */ ( !isFlippedBase && calendar.disabled( dateObject ) ) ||
  455.         /* 2 */ ( isFlippedBas/* 3 */lendar.disabled( dateObject ) && ( hasEnabledWeekdays || hasEnabledBeforeTarget || hasEnabledAfterTarget ) ) ||
  456.         /* 3// When inverted, flip the direction if there aren’t any enabled weekdays
  457. t.pick >// and there are no enabled dates in the direction of the interval.
  458. e direction if there aren’t any enabled weekdays
  459.         // and there are no enabled dates in the direction of the interval.
  460.         if ( isFlippedBase && !hasEnabledWeekdays && ( ( !hasEnabl// Keep looping until we reach an enabled date.
  461. BeforeTarget && /*safety &&*/) ) ) {
  462.             interval *= -1
  463.         }
  464.  
  465.  
  466.    /*safety -= 1
  467.             if ( !safety ) {
  468.                 throw 'Fell into an infinite loop while validating ' + dateObject.obj + '.'
  469.             }*/        if ( !s// If we’ve looped into the next/prev month with a large interval, return to the original date and flatten the interval.
  470.          // If we’ve looped into the next/prev month with a large interval, return to the original date and flatten the interval.
  471.             if ( Math.abs( interval ) > 1 && ( dateObject.month < originalDateObject.month || dateObject.month > originalDateObject.// If we’ve reached the min/max limit, reverse the direction, flatten the interval and set it to the limit.
  472.            }
  473.  
  474.  
  475.             // If we’ve reached the min/max limit, reverse the direction, flatten the interval and set it to the limit.
  476.             if ( dateObject.pick <= minLimitObject.pick ) {
  477.                 reachedMin = true
  478.                 interval = 1
  479.                 dateObject = calendar.create([
  480.                     minLimitObject.year,
  481.                     minLimitObject.month,
  482.                     minLimitObject.date + (dateObject.pick === minLimitObject.pick ? 0 : -1)
  483.                 ])
  484.             }
  485.             else if ( dateObject.pick >= maxLimitObject.pick ) {
  486.                 reachedMax = true
  487.                 interval = -1
  488.                 dateObject = calendar.create([
  489.                     maxLimitObject.year,
  490.                     maxLimitObject.mont// If we’ve reached both limits, just break out of the loop.
  491. == maxLimitObject.pick ? 0 : 1)
  492.                 ])
  493.             }
  494.  
  495.  
  496.             // If we’v// Finally, create the shifted date using the interval and keep looping.
  497. edMin && reachedMax ) {
  498.                 break
  499.             }
  500.  
  501.  
  502.             // Finally, create the shifted date using the inter//endif
  503. keep l// Return the date object settled on.
  504. dar.create([ dateObject.//DatePicker.prototype.validate
  505. ct/**
  506.  * Check if a date is disabled.
  507.  */endif
  508.  
  509.  
  510.     // Return the date object settled on.
  511.     return dateObject
  512. } //DatePicker.prototype.valida// Filter through the disabled dates to check if this is one.
  513. ype.disabled = function( dateToVerify ) {
  514.  
  515.     var
  516.         calendar = this,
  517.  
  518.         // Filter th// If the date is a number, match the weekday with 0index and `firstDay` check.
  519. ndar.item.disable.filter( function( dateToDisable ) {
  520.  
  521.             // If the date is a number, match the weekday with 0index and `firstDay` check.
  522.             if ( _.isInteger( dateToDisable )// If it’s an array or a native JS date, create and match the exact date.
  523. y ? dateToDisable : dateToDisable - 1 ) % 7
  524.             }
  525.  
  526.             // If it’s an array or a native JS date, create and match the exact date.
  527.             if ( $.isArray( dateToD// If it’s an object, match a date within the “from” and “to” range.
  528. ick === calendar.create( dateToDisable ).pick
  529.             }
  530.  
  531.             // If it’s an object, match a date within the “from” and “to// If this date matches a disabled date, confirm it’s not inverted.
  532.               return calendar.withinRange( dateToDisable, dateToVerify )
  533.             }
  534.         })
  535.  
  536.     // If this date matches a disabled date, confirm it’s not inverted.
  537.     isDisabledMatch = isDisabledMatch.length && !isDisabledMatch.filter(function( dateToDis// Check the calendar “enabled” flag and respectively flip the
  538. [3] // disabled state. Then also check if it’s beyond the min/max limits.
  539. isable.inverted
  540.     }).length
  541.  
  542.     // Check the calendar “enabled” flag and respectively flip the
  543.     // disabled state. Then also check if it’s beyond the min/max limi//DatePicker.prototype.disabled
  544. bl/**
  545.  * Parse a string into a usable type.
  546.  */ ||
  547.         dateToVerify.pick < calendar.item.min.pick ||
  548.         dateToVerify.pick > calendar.item.max.pick
  549.  
  550. } //DatePicke// If it’s already parsed, we’re good.
  551. g into a usable type.
  552.  */
  553. DatePicker.prototype.parse = function( type, value, op// We need a `.format` to parse the value with.
  554. ingObject = {}
  555.  
  556.     // If it’s already parsed, we’re good.
  557.     if ( !value || typeof value != 'string' ) {
  558.         return v// Convert the format into an array and then map through it.
  559. h.
  560.     if ( !( options && options.format ) ) {
  561.         options = options || {}
  562.         options.fo// Grab the formatting label.
  563. t
  564.     }
  565.  
  566.     // Convert the format into an array and then map through // The format length is from the formatting label function or the
  567. label ) {
  568.  
  569.  // label length without the escaping exclamation (!) mark.
  570.       formattingLabel = calendar.formats[ label ],
  571.  
  572.             // The format length is from the formatting label function or the
  573.             // label len// If there's a format label, split the value up to the format length.
  574.  = forma// Then add it to the parsing object with appropriate label.
  575. arsingObject ] ) : label.replace(    , '' ).length
  576.  
  577.         // If there's a format label, split the value up to the form// Update the value as the substring from format length to end.
  578. ropriate label.
  579.         if ( formattingLabel ) {
  580.         // Compensate for month 0index.
  581. ue.substr( 0, formatLength )
  582.         }
  583.  
  584.         // Update the value as the substring from format length to end.
  585.         value = value.substr( formatLength )
  586.     })
  587.  
  588.   //DatePicker.prototype.parse
  589. de/**
  590.  * Various formats to display the object in.
  591.  */gObject.yy,
  592.         +( parsingObject.mm || parsingO// Return the length of the first word in a collection.
  593. .d
  594.     ]
  595. } //DatePicker.prototype.parse
  596.  
  597.  
  598. /**
  599.  * Various formats to display the object// Grab the first word from the string.
  600. (functio// Regex pattern from http://stackoverflow.com/q/150033
  601. ollection.
  602.     function getWordLengthFromCollection( string, collecti// If there's no month index, add it to the date object
  603. the string.
  604.         // Regex pattern from http://stackoverflow.com/q/150033
  605.         var word = string.match(      }
  606.  
  607.         // )[ 0 ]
  608.  
  609.         // If there's no month index, add it to the date obje// Get the length of the first word in a string.
  610.  {
  611.             dateObject.m = collection.indexOf( word ) + 1
  612.         }
  613.  
  614.         // Return the length of the word.
  615.         return word.length
  616.     }
  617.  
  618.     // Get the length o// If there's string, then get the digits length.
  619. tWordLength(// Otherwise return the selected date.
  620. (     )[ 0 ].length
  621.     }
  622.  
  623.     return {
  624.  
  625.         d: function( string, dateObject ) {
  626.  
  627.             // If there's string, then get the// If there's a string, then the length is always 2.
  628. elected date// Otherwise return the selected date with a leading zero.
  629. ct.date
  630.         },
  631.         dd: function( string, dateObject ) {
  632.  
  633.             // If there's a string, then the length is always 2// If there's a string, then get the length of the first word.
  634. ing zero.
  635.   // Otherwise return the short selected weekday.
  636. .date )
  637.         },
  638.         ddd: function( string, dateObject ) {
  639.  
  640.             // If there's a string, then get the length of the first word.
  641.             // Otherwise return the// If there's a string, then get the length of the first word.
  642. rdLength( st// Otherwise return the full selected weekday.
  643. t.day ]
  644.         },
  645.         dddd: function( string, dateObject ) {
  646.  
  647.             // If there's a string, then get the length of the first word.
  648.             // Otherwise retur// If there's a string, then get the length of the digits
  649. etFirstWordL// Otherwise return the selected month with 0index compensation.
  650.       },
  651.         m: function( string, dateObject ) {
  652.  
  653.             // If there's a string, then get the length of the digits
  654.             // // If there's a string, then the length is always 2.
  655. nsation.
  656.    // Otherwise return the selected month with 0index and leading zero.
  657.       },
  658.         mm: function( string, dateObject ) {
  659.  
  660.             // If there's a string, then the length is always 2.
  661.             // Otherwise return the selected month with 0index and le// If there's a string, get length of the relevant month from the short
  662.  )
  663.         }// months collection. Otherwise return the selected month from that collection.
  664. is.settings.monthsShort
  665.  
  666.             // If there's a string, get length of the relevant month from the short
  667.             // months collection. Otherwise return the selected month from that collection.
  668.             return string ? getWordLengthFromCol// If there's a string, get length of the relevant month from the full
  669. h ]
  670.         // months collection. Otherwise return the selected month from that collection.
  671. this.settings.monthsFull
  672.  
  673.             // If there's a string, get length of the relevant month from the full
  674.             // months collection. Otherwise return the selected month from that col// If there's a string, then the length is always 2.
  675. mCollection(// Otherwise return the selected year by slicing out the first 2 digits.
  676.   },
  677.         yy: function( string, dateObject ) {
  678.  
  679.             // If there's a string, then the length is always 2.
  680.             // Otherwis// If there's a string, then the length is always 4.
  681.  digits.
  682.    // Otherwise return the selected year.
  683. eObject.year ).slice( 2 )
  684.         },
  685.         yyyy: function( string,// Create an array by splitting the formatting string passed.
  686. length is always 4.
  687.             // Otherwise return the selected year.
  688.             return string ? 4 : dateObject.y// Format an object into a string using the formatting options.
  689. atting string passed.
  690.         toArray: function( formatString ) { return formatString.split(         return calendar.form ) },
  691.  
  692.         // Format an object into a string using the formatting options.
  693.         toString: function ( formatString, itemObject ) {
  694.             var calendar = this
  695.             return calendar.formats.toArray( format//DatePicker.prototype.formats
  696.  {
  697.  /**
  698.  * Check if two date units are the exact.
  699.  */[ label ], calendar, [ 0, itemObject ] ) || label.replace(
  700.    , '' )
  701.             }).join// When we’re working with weekdays, do a direct comparison.
  702. /**
  703.  * Check if two date units are the exact.
  704.  */
  705. DatePicker.prototype.isDateExact = function( one, two ) {
  706.  
  707.     var calendar = this
  708.  
  709.     // When we’re working with wee// When we’re working with date representations, compare the “pick” value.
  710. er( two ) ) ||
  711.         ( typeof one == 'boolean' && typeof two == 'boolean' )
  712.      ) {
  713.         return one === two
  714.     }
  715.  
  716.     // When we’re working with date representations, compare the “pi// When we’re working with range objects, compare the “from” and “to”.
  717.     ( _.isDate( two ) || $.isArray( two ) )
  718.     ) {
  719.         return calendar.create( one ).pick === calendar.create( two ).pick
  720.     }
  721.  
  722.     // When we’re working with range objects, com/**
  723.  * Check if two date units overlap.
  724.  */€.
  725.     if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) {
  726.         return calendar.isDateExact( one.from, two.from ) && calendar.isDateE// When we’re working with a weekday index, compare the days.
  727. if two date units overlap.
  728.  */
  729. DatePicker.prototype.isDateOverlap = function( one, two ) {
  730.  
  731.     var calendar = this,
  732.         firstDay = calendar.settings.firstDay ? 1 : 0
  733.  
  734.     // When we’re working with a weekday index, compare the days.
  735.     if ( _.isInteger( one ) && ( _.isDate( two ) || $.isArray( two ) ) ) {
  736.         one = one % 7// When we’re working with range objects, check if the ranges overlap.
  737.    if ( _.isInteger( two ) && ( _.isDate( one ) || $.isArray( one ) ) ) {
  738.         two = two % 7 + firstDay
  739.         return two === calendar.c/**
  740.  * Flip the “enabled” state.
  741.  */we’re working with range objects, check if the ranges overlap.
  742.     if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) {
  743.         return calen/**
  744.  * Mark a collection of dates as “disabled”.
  745.  */
  746.  
  747. /**
  748.  * Flip the “enabled” state.
  749.  */
  750. DatePicker.prototype.flipEnable = function(val) {
  751.     var itemObject = this.item
  752.     itemObject.enable = v// If we’re flipping, that’s all we need to do.
  753. Mark a collection of dates as “disabled”.
  754.  */
  755. DatePicker.prototype.deactivate = function( type, datesToDisable ) {
  756.  
  757.     var calendar = this,
  758.         disabledItems = calendar.item.disable.slice(0)
  759.  
  760.  
  761.     // If we’re flipping, that’s all we need to do.
  762.     if ( datesToDis// Otherwise go through the dates to disable.
  763. ()
  764.     }
  765.  
  766.     else if ( datesToDisable === false ) {
  767.         calendar.flipEnable(1)
  768.         disabledItems = // When we have disabled items, check for matches.
  769.  
  770.         cal// If something is matched, immediately break out.
  771.  }
  772.  
  773.     // Otherwise go through the dates to disable.
  774.     else {
  775.  
  776.         datesToDisable.map(function( unitToDisable ) {
  777.  
  778.             var matchFound
  779.  
  780.             // When we have disabled items, check for matches.
  781.             // If something is matched, immediately break o// If nothing was found, add the validated unit to the collection.
  782. index += 1 ) {
  783.                 if ( calendar.isDateExact( unitToDisable, disabledItems[index] ) ) {
  784.                     matchFound = true
  785.                     break
  786.                 }
  787.             }
  788.  
  789.             // If nothing was found, add the validated unit to the collection.
  790.             if ( !matchFound ) {
  791.                 if (
  792.                     _.isInteger( unitToDisable ) ||
  793.                     _.isDate( unitToDisable ) ||
  794.    // Return the updated collection.
  795. Disable ) ||
  796.               //DatePicker.prototype.deactivate
  797. ab/**
  798.  * Mark a collection of dates as “enabled”.
  799.  */          ) {
  800.                     disabledItems.push( unitToDisable )
  801.                 }
  802.             }
  803.         })
  804.     }
  805.  
  806.     // Return the updated collection.
  807.     return disabledItems
  808. } //DatePick// If we’re flipping, that’s all we need to do.
  809. f dates as “enabled”.
  810.  */
  811. DatePicker.prototype.activate = function( type, datesToEnable ) {
  812.  
  813.     var calendar = this,
  814.         disabledItems = calendar.item.disable,
  815.         disabledItemsCount = disabledItems.length
  816.  
  817.     // If we’re flipping, that’s all we need to do// Otherwise go through the disabled dates.
  818.    calendar.flipEnable()
  819.     }
  820.  
  821.     else if ( datesToEnable === true ) {
  822.         calendar.flipEnable(1)
  823.         disabledItems = []
  824.     }
  825.  
  826.     else if ( datesToEnable === false ) {
  827.         c// Go through the disabled items and try to find a match.
  828.    // Otherwise go through the disabled dates.
  829.     else {
  830.  
  831.         datesToEnable.map(function( unitToEnable ) {
  832.  
  833.             var matchFound,
  834.  // When an exact match is found, remove it from the collection.
  835.     isExactRange
  836.  
  837.             // Go through the disabled items and try to find a match.
  838.             for ( index = 0; index < disabledItemsCount; index += 1 ) {
  839.  
  840.                 disabledUnit = disabledItems[index]
  841.  
  842.                 // When // When an overlapped match is found, add the “inverted” state to it.
  843.  ( calendar.isDateExact( disabledUnit, unitToEnable ) ) {
  844.                     matchFound = disabledItems[index] = null
  845.                     isExactRange = true
  846.                     break
  847.                 }
  848.  
  849.                 // When an overlapped match is found, add the “inverted” state to it.
  850.                 else if ( calendar.isDateOverlap( disabledUnit, unitToEnable ) ) {
  851.                     if ( $.isPlainObject( unitToEnable ) ) {
  852.                         unitToEnable.inverted = true
  853.                         matchFound = unitToEnable
  854.                     }
  855.                     else if ( $.isArray( unitToEnable ) ) {
  856.                         matchFound = unitToEnable
  857.                         if ( !matchFound[3] ) matchFound.push( 'inverted' )
  858.  // If a match was found, remove a previous duplicate entry.
  859.  unitToEnable ) ) {
  860.                         matchFound = [ unitToEnable.getFullYear(), unitToEnable.getMonth(), unitToEnable.getDate(), 'inverted' ]
  861.                     }
  862.                     break
  863.                 }
  864.             }
  865.  
  866.             // If a match was found, remove a previous duplicat// In the event that we’re dealing with an exact range of dates,
  867. abledItemsCo// make sure there are no “inverted” dates because of it.
  868.  disabledItems[index], unitToEnable ) ) {
  869.                     disabledItems[index] = null
  870.                     break
  871.                 }
  872.             }
  873.  
  874.             // In the event that we’re dealing with an exact range of dates,
  875.             // make sure there are no “inverted” dat// If something is still matched, add it into the collection.
  876. = 0; index < disabledItemsCount; index += 1 ) {
  877.                 if ( calendar.isDateOverlap( disabledItems[index], un// Return the updated collection.
  878.    disabledItems[index] = null
  879.                     break
  880.                 }//DatePicker.prototype.activate
  881. f /**
  882.  * Create a string for the nodes in the picker.
  883.  */
  884.             if ( matchFound ) {
  885.                 disabledItems.push( matchFound )
  886.             }
  887.         })
  888.     }
  889.  
  890.     // Return the updated collection.
  891.     return disabledItems.filter(function( val ) { return val != null })
  892. } //DatePicker.prototype.activate
  893.  
  894.  
  895. /**
  896.  * Create a string for the nodes in the picker.
  897.  */
  898. DatePicker.prototype.nodes = function( isOpen ) {
  899.  
  900.     var
  901.         calendar = this,
  902.         settings = calendar.settings,
  903.         calendarItem = calendar.item,
  904.         now// Create the calendar table head using a copy of weekday labels collection.
  905.     high// * We do a copy so we don't mutate the original array.
  906. ject = calendarItem.view,
  907.         disabledCollection = calendarItem.disable// If the first day should be Monday, move Sunday to the end.
  908. bject = calendarItem.max,
  909.  
  910.  
  911.         // Create the calendar table head using a copy of weekday labels collection.
  912.         // * We do a copy so we don't mutate the original array.
  913.     // Create and return the table head group.
  914. Collection ) {
  915.  
  916.             // If the first day should be Monday, move Sunday to the end.
  917.             if ( settings.firstDay ) {
  918.                 collection.push( collection.shift() )
  919.                 fullCollection.push( fullCollection.shift() )
  920.             }
  921.  
  922.             // Create and return the table head group.
  923.             return _.node(
  924.                 'thead',
  925.                 _.node(
  926.                     'tr',
  927.                     _.group({
  928.                         min: 0,
  929.                         max: DAYS_IN_WEEK - 1,
  930.                         i: 1,
  931.                         node: 'th',
  932.                         item: function( counter ) {
  933.                             ret//endreturn
  934.                           collection[ counter ],
  935.                                 settings.klass.weekdays,
  936.                                 '//tableHead
  937. tle="' + f// Create the nav for next/prev month.
  938.                     ]
  939.                         }
  940.          // Otherwise, return the created month tag.
  941. ) //endreturn
  942.         })( ( settings.showWeekdaysFull ? settings.weekdaysFull : settings.weekdaysShort ).slice( 0 ), settings.weekdaysFull.slice( 0 ) ), //tableHead
  943. // If the focused month is outside the range, disabled the button.
  944. hNav = function( next ) {
  945.  
  946.             // Otherwise, return the created month tag.
  947.             return _.node(
  948.                 'div',
  949.                 ' ',
  950.                 settings.klass[ 'nav' + ( next ? 'Next' : 'Prev' ) ] + (
  951.  
  952.                     // If the focused month is outside the range, disabled the button.
  953.                     ( next && viewsetObject.year >= maxLimitObject.year && viewsetObject.month >= maxLimitObject.month ) ||
  954.                     ( !next && viewsetObject.year <= minLimitObject.year && viewsetObject.month <= minLimitObject.month ) ?
  955.                     ' ' + settings.klass.navDisabled : ''
  956.                 ),
  957. //endreturn
  958.     'data-n//createMonthNav
  959. -1 ) + ' '// Create the month label.
  960. tr({
  961.                     role: 'button',
  962.                     controls: calendar.$node[0].id + '_table'
  963.                 }) + ' ' +
  964.                 'title="' + (// If there are months to select, add a dropdown menu.
  965. v ) + '"'
  966.             ) //endreturn
  967.         }, //createMonthNav
  968.  
  969.  
  970.         // Create the month label.
  971.         createMonthLabel = function() {
  972.  
  973.             var monthsCollection = settings.showMonthsShort ? settings.monthsShort : settings.monthsFull
  974.  
  975.             // If there are months to select, add a dropdown menu.
  976.             if ( settings.selectMonths ) {
  977.  
  978.                 re// The looped month and no classes.
  979.        _.group({
  980.                         min: 0,
  981.                         max: 11,
  982.                    // Set the value and selected index.
  983. de: 'option',
  984.                         item: function( loopedMonth ) {
  985.  
  986.                             return [
  987.  
  988.                                 // The looped month and no classes.
  989.                                 monthsCollection[ loopedMonth ], 0,
  990.  
  991.                                 // Set the value and selected index.
  992.                                 'value=' + loopedMonth +
  993.                                 ( viewsetObject.month == loopedMonth ? ' selected' : '' ) +
  994.                                 (
  995.                                     (
  996.                                         ( viewsetObject.year == minLimitObject.year && loopedMonth < minLimitObject.month ) ||
  997.                                         ( viewsetObject.year == maxLimitObject.year && loopedMonth > maxLimitObject.month )
  998.                                     ) ?
  999.                                     ' disabled' : ''
  1000.                                 )
  1001.                             ]
  1002.                         }
  1003.          // If there's a need for a month selector
  1004. s.klass.selectMonth,
  1005.                     ( isOpen ? '' : 'disabled' ) + ' ' +
  1006.                     _.ariaAttr(//createMonthLabel
  1007. r.$node[0]// Create the year label.
  1008.                     'title="' + settings.labelMonthSelect + '"'
  1009.                 )
  1010.             }
  1011.  
  1012.       // If years selector is set to a literal "true", set it to 5. Otherwise
  1013. e( 'div', mo// divide in half to get half before and half after focused year.
  1014.     }, //createMonthLabel
  1015.  
  1016.  
  1017.         // Create the year label.
  1018.         createYearLabel = function() {
  1019.  
  1020.     // If there are years to select, add a dropdown menu.
  1021.      // If years selector is set to a literal "true", set it to 5. Otherwise
  1022.             // divide in half to get half before and half after focused year.
  1023.             numberYears = settings.selectYears === true ? 5 : ~~( settings.selectYears / 2 )
  1024.  
  1025.             // If there are years to select,// If the min year is greater than the lowest year, increase the highest year
  1026.                 // by the difference and set the lowest year to the min year.
  1027.  maxLimitObject.year,
  1028.                     lowestYear = focusedYear - numberYears,
  1029.                     highestYear = focusedYear + numberYears
  1030.  
  1031.                 // If the min year // If the max year is less than the highest year, decrease the lowest year
  1032. // by the differ// by the lower of the two: available and needed years. Then set the
  1033. nYear > lowestYe// highest year to the max year.
  1034. tYear += minYear - lowestYear
  1035.                     lowestYear = minYear
  1036.                 }
  1037.  
  1038.                 // If the max year is less than the highest year, decrease the lowest year
  1039.                 // by the lower of the two: available and needed years. Then set the
  1040.                 // highest year to the max year.
  1041.                 if ( maxYear < highestYear ) {
  1042.  
  1043.                     var availableYears = lowestYear - minYear,
  1044.                         neededYears = highestYear - maxYear
  1045.  
  1046.                     lowestYear -= availableYears > neededYears ? neededYears : availableYears
  1047.                     highestYear = maxYear
  1048.                 }
  1049.  
  1050.                 return _.node( 'se// The looped year and no classes.
  1051. {
  1052.                         min: lowestYear,
  1053.                         max: highestY// Set the value and selected index.
  1054.                       node: 'option',
  1055.                         item: function( loopedYear ) {
  1056.                             return [
  1057.  
  1058.                                 // The looped year and no classes.
  1059.                                 loopedYear, 0,
  1060.  
  1061.                                 // Set the value and selected index.
  1062.                                 'value=' + loopedYear + ( focusedYear == loopedYear ? ' selected' : ''
  1063.                )
  1064.            }
  1065.  
  1066.            // Otherwise just return the year focused
  1067.            return _.node( 's.selectYear,
  1068.                     ( isOpen ? '' : '//createYearLabel
  1069. + _.ar// Create and return the entire calendar.
  1070. '_table' }) + ' ' +
  1071.                     'title="' + settings.labelYearSelect + '"'
  1072.                 )
  1073.             }
  1074.  
  1075.             // Otherwise just return the year focused
  1076.             return _.node( 'div', focusedYear, settings.klass.year )
  1077.         } //createYearLabel
  1078.  
  1079.  
  1080.     // Create and return the entire calendar.
  1081.     return _.node(
  1082.         'div',
  1083.         ( settings.selectYears ? createYearLabel() + createMonthLabel() : createMonthLabel() + createYearLabel() ) +
  1084.         createMonthNav() + createMonthNav( 1 ),
  1085.         setti// If Monday is the first day and the month starts on Sunday, shift the date back a week.
  1086.         'tbody',
  1087.             _.group({
  1088.                 min: 0,
  1089.                 max: WEEKS_IN_CALENDAR - 1,
  1090.                 i: 1,
  1091.                 node: 'tr',
  1092.                 item: function( rowCounter ) {
  1093.  
  1094.                     // If Monday is the first day and the month starts on Sunday, shift the date ba// Add 1 for weekday 0index
  1095.    var shiftDateBy = settings.firstDay && calendar.create([ viewsetObject.year, viewsetObject.month, 1 ]).day === 0 ? -7 : 0
  1096.  
  1097.                     return [
  1098.                         _.group({
  1099.                             min: DAYS_IN_WEEK * rowCounter - viewsetObject.day + shiftDateBy + 1, // Add 1 for weekday 0i// Convert the time date from a relative date to a target date.
  1100.                    return this.min + DAYS_IN_WEEK - 1
  1101.                             },
  1102.                             i: 1,
  1103.                             node: 'td',
  1104.                             item: function( targetDate ) {
  1105.  
  1106.                                 // Convert the time date from a relative date to a target date.
  1107.                                 targetDate = calendar.create([ viewsetObject.year, viewsetObject.month, targetDate + ( settings.firstDay ? 1 : 0 ) ])
  1108.  
  1109.                                 var isSelected = selectedObject && selectedObject.pick == targetDate.pick,
  1110.                                     isHighlighted = highlightedObject && highlightedObject.pick == targetDate.pick,
  1111.                                     isDisabled = disabledCollection && calendar.disabled( targetDate ) || targetDate.pick < minLimitObject.pick || targetDate.pick > maxLimitObject.pick,
  1112.                                     formattedDate = _.trigger( calendar.formats.toString, calendar, [ settings.format// Add the `infocus` or `outfocus` classes based on month in view.
  1113.                             _.node(
  1114.                                         'div',
  1115.                                         targetDate.date,
  1116.                                         (function( klass// Add the `today` class if needed.
  1117.                 // Add the `infocus` or `outfocus` classes based on month in view.
  1118.                                             klasses.push( viewsetObject.month == targetDate.month ? settings.klass.infocus : settings.klass.outfocus )
  1119.  
  1120.                           // Add the `selected` class if something's selected and the time matches.
  1121.                         if ( nowObject.pick == targetDate.pick ) {
  1122.                                                 klasses.push( settings.klass.now )
  1123.                                             }
  1124.  
  1125.                                             //// Add the `highlighted` class if something's highlighted and the time matches.
  1126.                                     if ( isSelected ) {
  1127.                                                 klasses.push( settings.klass.selected )
  1128.                                             }
  1129.  
  1130.                                             // Add the `hi// Add the `disabled` class if something's disabled and the object matches.
  1131.                                   if ( isHighlighted ) {
  1132.                                                 klasses.push( settings.klass.highlighted )
  1133.                                             }
  1134.  
  1135.                                             // Add the `disabled` class if something's disabled and the object matches.
  1136.                                             if ( isDisabled ) {
  1137.                                                 klasses.push( settings.klass.disabled )
  1138.                                             }
  1139.  
  1140.                                             return klasses.join( ' ' )
  1141.                                         })([ settings.klass.day ]),
  1142.                                         'data-pick=' + targetDate.pick + ' ' + _.ariaAttr({
  1143.                                             role: 'gridcell',
  1144.                                             label: formattedDate,
  1145.                                             selected: isSelected && calendar.$node.val() === formattedDate ? true : null,
  1146.                                             activedescendant: isHighlighted ? true ://endreturn
  1147.                                        disabled: isDisabled ? true : null
  1148.      //endreturn
  1149.                        })
  1150.                                     ),
  1151.                                     '',
  1152.                                     _.ariaAttr({ role: 'presentation' })
  1153.                                 ] //endreturn
  1154.                             }
  1155.             // * For Firefox forms to submit, make sure to set the buttons’ `type` attributes as “button”.
  1156. settings.klass.table,
  1157.         'id="' + calendar.$node[0].id + '_table' + '" ' + _.ariaAttr({
  1158.             role: 'grid',
  1159.             controls: calendar.$node[0].id,
  1160.             readonly: true
  1161.         })
  1162.     ) +
  1163.  
  1164.     // * For Firefox forms to submit, make sure to set the buttons’ `type` attributes as “button”.
  1165.     _.node(
  1166.         'div',
  1167.         _.node( 'button', settings.today, settings.klass.buttonToday,
  1168.             'type=button data-pick=' + nowObject.pick +
  1169.             ( isOpen && !calendar.disabled(nowObject) ? ''button'sabled' ) + ' ' +
  1170.             _.ariaAttr({ controls: calendar.$node[0].id }) ) +
  1171.         _.node( 'button', settings.clear, settings.klass.buttonClear,
  1172.             'type=button data-clear=1' +
  1173.             ( isOpen ? '' : ' disabled' ) + ' '//endreturn
  1174.   //DatePicker.prototype.nodes
  1175. dar./**
  1176.  * The date picker defaults.
  1177.  */utton', settings.close, settings.klass.buttonClose,
  1178.             'typ// The title label to use for the month nav buttons
  1179. '' : ' disabled' ) + ' ' +
  1180.             _.ariaAttr({ controls: calendar.$node[0].id }) ),
  1181. // The title label to use for the dropdown selectors
  1182. atePicker.prototype.nodes
  1183.  
  1184.  
  1185.  
  1186.  
  1187. /**
  1188.  * The date picker defaults.
  1189.  */
  1190. DatePicker.defaults = (funct// Months and weekdays
  1191. turn {
  1192.  
  1193.         // The title label to use for the month nav buttons
  1194.         labelMonthNext: 'Next month',
  1195.         labelMonthPrev: 'Previous month',
  1196.  
  1197.         // The title label to use for the dropdown selectors
  1198.         labelMonthSelect: ', 'ect a month',
  1199.         labelYearSelect: 'Sunday'a year',
  1200.  
  1201.         // Months and weekdays
  1202.         monthsFull: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'Octobe// Today and clear
  1203. cember' ],
  1204.         monthsShort: [ 'Jan', 'Feb',
  1205.        close: 'ay', ',
  1206.  
  1207.        // Picker close behavior
  1208.        closeOnSelect: true,
  1209.        closeOnClear: true,
  1210.  
  1211.        // The format to show on the `input` element
  1212.        format: 'ekdaysShort: [ 'Sun', 'M// Classes
  1213.  'Wed', 'Thu', 'Fri', 'Sat' ],
  1214.  
  1215.         // Today and clear
  1216.         today: 'Today',
  1217.         clear: 'Clear',
  1218.         close: 'Close',
  1219.  
  1220.         // Picker close behavior
  1221.         closeOnSelect: true,
  1222.         closeOnClear: true,
  1223.  
  1224.         // The format to show on the `input` element
  1225.         format: 'd mmmm, yyyy',
  1226.  
  1227.         // Classes
  1228.         klass: {
  1229.  
  1230.             table: prefix + 'table',
  1231.  
  1232.             header: prefix + 'header',
  1233.  
  1234.             navPrev: prefix + 'nav--prev',
  1235.             navNext: prefix + 'nav--next',
  1236.             navDisabled: prefix + 'nav--disabled',
  1237.  
  1238.             month: prefix + 'month',
  1239.             year: prefix + 'year',
  1240.            now: prefix + 'refix + 'select--month',
  1241.             selectYear: prefix + 'select--year',
  1242.  
  1243.             weekdays: prefix + 'weekday',
  1244.  
  1245.             day: prefix + ',
  1246.  
  1247.            buttonClear: prefix + 'day--disabled',
  1248.            buttonToday: prefix + '--selected',
  1249.             highlighted: prefix + 'day--highlighted'
  1250.        }
  1251.    }
  1252. })( Picker.klasses().picker + '      infoc/**
  1253.  * Extend the picker to add the date picker.
  1254.  */refix + 'day--outfocus',
  1255.  
  1256.             footer: pr

Raw Paste


Login or Register to edit or fork this paste. It's free.