alumuko / vanilla-datetimerange-picker

A JavaScript component that is a date & time range picker, no need to build, no dependencies except Moment.js, that is based on Dan Grossman's bootstrap-daterangepicker.
MIT License
148 stars 17 forks source link

How do I destroy/clear the DateRangePicker out of memory so that it doesn't exist anymore? #3

Open shaunroselt opened 2 years ago

shaunroselt commented 2 years ago

Let's say I create the following one:

    let Test = new DateRangePicker('CalendarDiv', {
            startDate: moment().startOf('day'),
            singleDatePicker: true,
            showDropdowns: true,
            opens: 'right',
            minYear: 2000,
            maxYear: new Date().getFullYear(),
            maxDate: moment() //Stops user from choosing future dates
    }, function(start, end){
    });

How would I go about destroying the object?

Test = null;

Is this possible? What is the best method?

I don't want the object to exist anymore.