JAVASCRIPT   8

picker.date.js

Guest on 24th May 2021 03:46:22 AM

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

Raw Paste


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