Daemonite / material

Material Design for Bootstrap 4
http://daemonite.github.io/material/
MIT License
3.2k stars 725 forks source link

Update or destroy instance of date picker #242

Open halfpastfouram opened 4 years ago

halfpastfouram commented 4 years ago

It seems that once you've created an instance of a datepicker you cannot update or destroy it.

For instance: I need to be able to update it by changing the min or max selectable date. This seems to be impossible right now.

Maybe, after the plugin is updated add the same support that the base plugin provides. This way all properties can be set like so:

// Using arrays formatted as [YEAR,MONTH,DATE].
picker.set('max', [2015,3,20])

// Using JavaScript Date objects.
picker.set('min', new Date(2015,7,14))

// Using formatted strings.
picker.set('max', '20 April, 2016'))

// Using integers as days relative to today.
picker.set('max', 4)

// Using `true` for “today”.
picker.set('max', true)

// Using `false` to remove.
picker.set('max', false)
MROALI commented 4 years ago

You can do it using the following : picker.pickadate("picker").$root.remove()

Hope that will help