Sha256: 5ca73d9fa8bbc8dca64246be0124182cd08b0b4f447305bb1b2105c1e623b01c

Contents?: true

Size: 825 Bytes

Versions: 4

Compression:

Stored size: 825 Bytes

Contents

var CoreDatepicker = (function () {

  function initializeDatetime (datetime) {
    var datetimeInput = $(datetime).find('.inputs__input--datetime')
    $(datetimeInput).datetimepicker({
      format: 'd/m/Y H:i'
    })
  }

  function initializeDate (date) {
    var dateInput = $(date).find('.inputs__input--date')
    $(dateInput).datetimepicker({
      timepicker: false,
      format: 'd/m/Y'
    })
  }

  function _initDatetime () {
    $('.inputs-datetime').each(function () {
      initializeDatetime(this)
    })
  }

  function _initDate () {
    $('.inputs-date').each(function () {
      initializeDate(this)
    })
  }
  
  // Init:
  function init () {
    _initDatetime()
    _initDate()
  }

  return {
    init: init,
    initializeDate: initializeDate,
    initializeDatetime: initializeDatetime
  }

})()

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lato_core-2.2.2 app/assets/javascripts/lato_core/modules/CoreDatepicker.js
lato_core-2.2.0 app/assets/javascripts/lato_core/modules/CoreDatepicker.js
lato_core-2.1.4 app/assets/javascripts/lato_core/modules/CoreDatepicker.js
lato_core-2.1.3 app/assets/javascripts/lato_core/modules/CoreDatepicker.js