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

CalBox could be more forthcoming with what's happening #448

Closed jtsage closed 5 years ago

jtsage commented 5 years ago

So, calbox is the mode people most like to bolt other functionality on. It could be a little more forthcoming.

So, with that in mind:

Fixed: "displayChange" listener.

$(document).on("datebox", function(e,p) {
  if ( p.method === "displayChange" ) { ... }
});

This only fires with calbox, and first along with the offset event.

Added : getSelectedDate function

var date = $( "#datebox" ).datebox( "getSelectedDate" );

Gets the currently user selected date, or the default, or today.

Added: getCalStartGrid

var date = $( "#datebox" ).datebox( "getCalStartGrid" );

Gets beginning date of the currently visible calendar grid. If the calendar has not yet been open, or not in calbox, it'll return false.

Added: getCalEndGrid

var date = $( "#datebox" ).datebox( "getCalEndGrid" );

Gets ending date of the currently visible calendar grid. If the calendar has not yet been open, or not in calbox, it'll return false.

Added: isSelectedInCalGrid

if ( $( "#datebox" ).datebox( "isSelectedInCalGrid" ) ) {
    ...
}

Boolean if the currently selected (or default, or today) date appears in the visible calendar grid. If the calendar has not yet been open, or not in calbox, it'll return false.

Added: isInCalGrid

if ( $( "#datebox" ).datebox( "isInCalGrid", new Date() ) ) {
    ...
}

Boolean if the specified date (object) appears in the visible calendar grid. If the calendar has not yet been open, or not in calbox, it'll return false.