Meteor-Community-Packages / meteor-autoform-bs-datepicker

Custom "bootstrap-datepicker" input type for AutoForm
MIT License
25 stars 32 forks source link

Problem using multidate option #49

Closed luixal closed 6 years ago

luixal commented 6 years ago

Hi,

When trying to use the multidate option, I set a schema with a field like this:

freeYearDaysMultiple: {
  type: String,
  label: function () { return I18N.translate('freeYearDays'); },
  optional: true,
  autoform: {
    type: 'bootstrap-datepicker',
    datePickerOptions: {
      multidate: true
    }
  }
}

The expected behaviour is to get a String formed by multiple dates (i.e: 02/01/2018,03/01/2018,04/01/2018). You actually get a String but containing only one date.

I've tried this config on rajit's package and it works well so I guess is something related to this package.

Any ideas?

luixal commented 6 years ago

My bad, didn't notice this plugin was already chasing the cases for multiple values. Defining the field like this:

  freeYearDays: {
    type: [Date],
    label: function () { return I18N.translate('freeYearDays'); },
    optional: true,
    autoform: {
      type: 'bootstrap-datepicker',
      datePickerOptions: {
        multidate: true,
        language: 'es'
      }
    }
  },

Works like a charm :)