       new Date('Invalid Date')
 
 dateTimeLocalizer = -> if moment? then new DateTimeLocalizerMoment else new DateTimeLocalizer
-hx.dateTimeLocalizer = dateTimeLocalizer+hx.dateTimeLocalizer = dateTimeLocalizer

  dateOrder: -> ['DD','MM','YYYY']

  # get the day the week starts on, 0 for sunday, 1 for monday etc.
  weekStart: -> 0

  # localise the days of the week and return as array of 2 char days ('Su', 'Mo' etc.)
  weekDays: -> ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']

  # localise 'today' text
  todayText: -> 'Today'

    if result.length is 0 then result = ['DD','MM','YYYY']
    result

  weekStart: -> moment().locale(hx.preferences.locale()).weekday(0).toDate().getDay()

  weekDays: ->
    dayDate = moment().weekday(0)
