initial github commit

This commit is contained in:
2017-12-21 11:42:41 +01:00
commit a57548c7da
209 changed files with 3841 additions and 0 deletions
@@ -0,0 +1,24 @@
import Ember from 'ember'
import UiCalendarComponent from 'ember-semantic-ui-calendar/components/ui-calendar'
{ computed, inject, merge } = Ember
export default UiCalendarComponent.extend
momentValue: null
firstDayOfWeek: null
is_date: false
# Provide the Date object that is used by ui-calendar
date: computed('momentValue', ->
if momentValue = @get('momentValue') then momentValue.toDate() else null
).readOnly()
willInitSemantic: (settings) ->
settings.firstDayOfWeek = if Number.isFinite(@get('firstDayOfWeek')) then @get('firstDayOfWeek') else (if Number.isFinite(@get('globals.first_day_of_week')) then @get('globals.first_day_of_week') else 1)
@_super arguments...
@set('is_date', true) if @get('momentValue._f') is 'YYYY-MM-DD' or @get('momentValue._ambigTime') or @get('type') is 'date'
merge settings,
onChange: (date) ->
# Wraps the Date in a moment object an triggers the onChange action
momentDate = if date then moment(date) else null
momentDate._ambigTime = true if momentDate and @get('is_date')
@sendAction 'onChange', momentDate