Use fomantic calendar

This commit is contained in:
2019-10-18 16:08:57 -05:00
parent 310a0e1187
commit e75846282e
2 changed files with 15 additions and 11 deletions
@@ -7,6 +7,7 @@
* http://opensource.org/licenses/MIT * http://opensource.org/licenses/MIT
*/ */
debugger;
; ;
(function ($, window, document, undefined) { (function ($, window, document, undefined) {
@@ -1,15 +1,18 @@
#= require ./calendar-vendor # require ./calendar-vendor
Dunlop.register_setup 'calendar', (target) -> Dunlop.register_setup 'calendar', (target) ->
target.find('.datepicker').calendar target.find('.datepicker').each ->
firstDayOfWeek: 1 options =
type: 'date' firstDayOfWeek: 1
formatter: type: 'date'
date: (date, settings) -> formatter:
return '' unless date date: (date, settings) ->
moment(date).format().substr(0, 10) return '' unless date
datetime: (date, settings) -> moment(date).format().substr(0, 10)
return '' unless date datetime: (date, settings) ->
moment(date).format().substr(0, 10) return '' unless date
moment(date).format().substr(0, 10)
options.showWeekNumbers = true if $(@).data().hasOwnProperty('showWeekNumbers')
$(@).calendar options
target.find('.timepicker').calendar target.find('.timepicker').calendar
ampm: false ampm: false