jtsage / jtsage-datebox

A multi-mode date and time picker for Bootstrap (3&4), jQueryMobile, Foundation, Bulma, FomanticUI, and UIKit (or others)
http://datebox.jtsage.dev/
Other
474 stars 166 forks source link

Add buttons and specific classes #398

Closed verbim closed 7 years ago

verbim commented 8 years ago

Hi, I have two queries with slidebox format.

  1. It does not show the previous and next buttons.
  2. I would like to add a class specifies the days that can not be selected.

My code is:

input class="form-control hidden" type="text" id="sb1" data-options='{"mode": "slidebox", "blackDates": ["2016-10-27"] }'

$('#sb1').datebox({ overrideSlideFieldOrder: ['m','d'], useInline: true, buttonIcon: true, minDays: 7, maxDays: 15 });

adsgm commented 8 years ago

Hello,

I am also looking for a way to add classes to the blackDays (slidebox in JQuery UI version).

@verbim for previous and next buttons I worked it out with custom buttons like this:

$('#next-week').click(function(){ 
   $('#date').trigger('datebox', {'method':'dooffset', 'amount': 5, 'type': 'd' }); 
});

In this case the amount is the number of visible days. I hope it helps you

Regards

jtsage commented 7 years ago

Re: previous / next buttons.

They don't yet exist in slidebox. I need to be convinced they should. What's the use-case?

Re: add classes to blackDays - a class to all of them, or a class per black day? Right now, slidebox is the fastest of all the modes (except maybe original datebox), because it does lazy checking - it does not look at the individual dates while in generates, unlike many of the other modes.