Giter Site home page Giter Site logo

ab-datepicker's Introduction

ab-datepicker

ab-datepicker is an accessible datepicker based on the example of the Open AJAX Alliance Accessibility Tools Task Force : http://www.oaa-accessibility.org/examplep/datepicker1/ and Inspired by http://wet-boew.github.io/wet-boew/demos/datepicker/datepicker-en.html

Table of contents

  1. Description
  2. Dependencies
  3. Demo
  4. Usage
  5. Configuration options
  6. Methods
  7. Events
  8. Theming
  9. Keyboard interaction
  10. ARIA 1.0 Markup
  11. Browser Compatibility
  12. Copyright and license

Description

This DatePicker widget is a jQuery Plugin which allows the user to select a date. It implements the WAI-ARIA Date Picker design pattern of W3C.

The calendar portion of the date picker follows a table structure where days of the week and calendar day numbers are layed out in HTML table cells where WAI-ARIA semantics for a grid are applied. This provides context so an assistive technology can render the day of the week; its corresponding numeric calendar day, and week number if necessary.

The calendar portion can be displayed in a numbers of ways, including as a popup in modal mode.

↑ back to table of contents

Dependencies

↑ back to table of contents

Demo

Online Demo

↑ back to table of contents

Usage

The datepicker component must be bound to an text input field of your document:

<input class="date form-control" id="date1" type="text" placeholder="d/M/y" title="format: dd/MM/y"/>

For better accessibility, define an placeholder attribute and a title giving the input format to the screen reader.

Add the bootstrap and datepicker css to your page head

<link rel="stylesheet" href="path/to/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="path/to/datepicker.css" type="text/css" />
or
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ab-datepicker@latest/css/datepicker.css" type="text/css" />

In case you use bootstrap4 markup (see the markup option), it is necessary to include font 'Font Awesome 5':

<link rel="stylesheet" href="path/to/font-awesome5.min.css" type="text/css" />

Place the javascript files to the end of your document:

<script type="text/javascript" src="path/to/jquery.min.js"></script>
<script type="text/javascript" src="path/to/bootstrap.min.js"></script>
<script type="text/javascript" src="path/to/datepicker.min.js"></script>
or
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ab-datepicker@latest"></script>

Basic usage

Add this code to the end of your document:

    <script type="text/javascript">
    $(document).ready(function() {
    	$('.date').datepicker();
    });
    </script>

This code displays the default calendar (in english with the bootstrap 3 markup and the default theme : no colors)

AngularJS

ab-datepicker can be used with this AngularJS directive written by @dadoadk

Advanced usage including Internationalization

First, place your "locales" file before "datepicker.min.js" For example, if your language is French, add this line :

<script type="text/javascript" src="path/to/locales/fr.min.js"></script>

and give some options to the datepicker. See Configuration options below.

    <script type="text/javascript">
    $(document).ready(function() {
    	$('.date').datepicker({
			firstDayOfWeek: 1, // The first day of week is Monday
			weekDayFormat: 'narrow', // Only first letter for the weekday names
			inputFormat: 'd/M/y',
			outputFormat: 'dd/MM/y',
			titleFormat: 'EEEE d MMMM y',
			markup: 'bootstrap4',
			theme: 'blue',
			modal: false
		});
    });
    </script>

↑ back to table of contents

Configuration options

Option Description Default Example
allowSameDate In the case of linked dates (start date and end date), this option indicates whether the two dates can be the same. This option is ignored if none of the 'next' or 'previous' option is set. true allowSameDate: false
buttonLabel Accessibility label : 'aria-labelledby' attribute for the calendar button Date.dp_locales.texts.buttonLabel (*) Cliquez ou appuyez sur la touche Entrée ou la barre d'espace pour ouvrir le calendrier
buttonLeft Place the calendar button to the left of the text field false buttonLeft: true
buttonTitle Title attribute for the calendar button Date.dp_locales.texts.buttonTitle (*) Sélectionner une date ...
changeMonthButtonLabel Accessibility label : title attribute for the calendar title when the current month is displayed Date.dp_locales.texts.changeMonthButtonLabel (*) changeMonthButtonLabel: "Cliquez ou appuyez sur la touche Entrée ou la barre d'espace pour changer le mois"
changeRangeButtonLabel Accessibility label : title attribute for the calendar title when the current years range is displayed Date.dp_locales.texts.changeRangeButtonLabel (*) changeRangeButtonLabel: "Cliquez ou appuyez sur la touche ou sur la barre Entrée pour afficher les vingt années suivantes"
changeYearButtonLabel Accessibility label : title attribute for the calendar title when the current year is displayed Date.dp_locales.texts.changeYearButtonLabel (*) changeYearButtonLabel: "Cliquez ou appuyez sur la touche Entrée ou la barre d'espace pour changer l'année"
closeButtonLabel Accessibility label : 'aria-labelledby' attribute for the close button when the calendar is displayed in modal mode Date.dp_locales.texts.closeButtonLabel (*) closeButtonLabel: "Fermez le calendrier"
closeButtonTitle Title attribute for the close button when the calendar is displayed in modal mode Date.dp_locales.texts.closeButtonTitle (*) closeButtonTitle: "Fermer"
datesDisabled Array of dates to disable. array items are Date object or string [] datesDisabled: [new Date(2017, 12, 11), '12/12/2017']
daysOfWeekDisabled Array of the week days number to disable [] daysOfWeekDisabled: [0, 6]
firstDayOfWeek Determines the first column of the calendar grid
0 = Sunday, 1 = Monday, ....
Date.dp_locales.firstday_of_week (*) firstDayOfWeek: 1
gainFocusOnConstruction Indicates if the datepicker should gain focus when it is constructed true gainFocusOnConstruction: false
inline Display the datepicker inline inside a given div false inline: $('#inline-div')
inputFormat date input format by the user. Dates and times are formatted according to CLDR Date Time patterns Date.dp_locales.short_format (*) inputFormat: 'd/M/y'
isDateDisabled A function that is called for each date of the days calendar. Must return true if the date provided as argument must be disabled, false otherwise. null function (date) { return date < new Date(); }
isMonthDisabled A function that is called for each date of the days calendar and each month of the months calendar. Must return true if the month provided as arguments (year and month number - 1 to 12) must be disabled, false otherwise. null function (year, month) { return year < 2000
isYearDisabled A function that is called for each date of the days calendar, each month of the months calendar and each year of the year calendar. Must return true if the year provided as argument must be disabled, false otherwise. null function (year) { return year < 2000; }
markup The html markup to use bootstrap3 markup: 'bootstrap4'
max The maximum/latest date that can be selected null max: '06/12/2016'
min The minimum/earliest date that can be selected null min: '08/11/2015'
modal Indicates if the calendar must be opened in modal mode, that is it keeps the focus until the user selects a date or clicks the close button false modal: true
next Link the target input of the datepicker to the input of another datepicker that represents the end date of a range null next: '#enddate' or next: $('#enddate')
nextButtonLabel Accessibility label : 'aria-labelledby' attribute for the next month button Date.dp_locales.texts.nextButtonLabel (*) nextButtonLabel: "Aller au mois suivant"
nextMonthButtonLabel Accessibility label : 'aria-labelledby' attribute for the next year button Date.dp_locales.texts.nextMonthButtonLabel (*) nextMonthButtonLabel: "Aller à l'année suivante"
nextYearButtonLabel Accessibility label : 'aria-labelledby' attribute for the next years range button Date.dp_locales.texts.nextYearButtonLabel (*) nextYearButtonLabel: "Allez aux vingt années suivantes"
onUpdate A function that is called when the input box has been updated by the datepicker function (value) {} function (value) { console.log("date updated : " + value); }
outputFormat date output format of the datepicker. Dates and times are formatted according to CLDR Date Time patterns Date.dp_locales.short_format (*) outputFormat: 'dd/MM/y'
prevButtonLabel Accessibility label : 'aria-labelledby' attribute for the previous month button Date.dp_locales.texts.prevButtonLabel (*) prevButtonLabel: "Aller au mois précédent"
previous Link the target input of the datepicker to the input of another datepicker that represents the start date of a range null previous: '#startdate' or previous: $('#startdate')
prevMonthButtonLabel Accessibility label : 'aria-labelledby' attribute for the previous year button Date.dp_locales.texts.prevMonthButtonLabel (*) prevMonthButtonLabel: "Aller à l'année précédente"
prevYearButtonLabel Accessibility label : 'aria-labelledby' attribute for the previous years range button Date.dp_locales.texts.prevYearButtonLabel (*) prevYearButtonLabel: "Aller aux vingt années précédentes"
startView set the start view mode. Accepts: 'days', 'months', 'years', 0 for days, 1 for months and 2 for years 0 startView: 'years'
theme name of the theme default theme: 'green'
titleFormat Dates and times are formatted according to CLDR Date Time patterns Date.dp_locales.full_format (*) titleFormat: 'EEEE d MMMM y'
weekDayFormat Display format of the weekday names
- values are 'short' (first letter) or 'narrow' (first two letters)
short weekDayFormat: 'narrow'

(*) Default value from the locale file

↑ back to table of contents

Methods

datesDisabled

$('your date selector').datepicker('datesDisabled', dates);

Sets a specific date or an array of dates to be disabled. The dates are Date objects or strings.

daysOfWeekDisabled

$('your date selector').datepicker('daysOfWeekDisabled', value);

where value (type: array of number) is the list of days of the week that should be disabled.

disable

$('your date selector').datepicker('disable');

Disable the datepicker. This method has no effect on an inline datepicker.

enable

$('your date selector').datepicker('enable');

Enable the datepicker.

firstDayOfWeek

$('your date selector').datepicker('firstDayOfWeek', value);

where value (type: integer) is the day of week (0: Sunday, 1: Monday, 2: Tuesday, ...)

getDate

$('your date selector').datepicker('getDate');

Get the current Datepicker date object

hide

$('your date selector').datepicker('hide');

hide the calendar portion of the datepicker

inline

$('your date selector').datepicker('inline', value);

Display the datepicker inline inside a given div. value can be the id of a div, a jQuery object of a div or false.

inputFormat

$('your date selector').datepicker('inputFormat', formats);

where formats (type: array of string) contains the acceptable input formats according to CLDR Date Time patterns

max

$('your date selector').datepicker('max', date);

Define the biggest date the user can enter. The value of "date" (type: string) must conform to one of the formats defined with the "inputFormat" option

min

$('your date selector').datepicker('min', date);

Define the smallest date the user can enter. The value of "date" (type: string) must conform to one of the formats defined with the "inputFormat" option.

next

$('your date selector').datepicker('next', selector);

Define the date as the start date of a period. The value of "selector" (type: string or JQuery object) refers to the input that represents the end date of the period.

previous

$('your date selector').datepicker('previous', selector);

Define the date as the end date of a period. The value of "selector" (type: string or JQuery object) refers to the input that represents the start date of the period.

modal

$('your date selector').datepicker('modal', bool);

Defines the opening mode (modal or not) of the calendar portion of the datepicker. bool can be true or false.

outputFormat

$('your date selector').datepicker('outputFormat', format);

where format (type: string) contains the output format according to CLDR Date Time patterns

setDate

$('your date selector').datepicker('setDate', date);

Returns the internal date object of the datepicker

show

$('your date selector').datepicker('show');

show the calendar portion of the datepicker

startview

$('your date selector').datepicker('startview', view);

where view (type: string|int) is the value of new start view: 'days', 'months', 'years', 0 for days, 1 for months and 2 for years

theme

$('your date selector').datepicker('theme', name);

where name (type: string) contains the name of your theme

weekDayFormat

$('your date selector').datepicker('weekDayFormat', value);

where value (type: string) is one of this value : 'short' (first letter) or 'narrow' (first two letters)

↑ back to table of contents

Events

change

This event is triggered, bound to target input box, once the date is changed by the datepicker.

ab.datepicker.opening

This event is triggered, bound for all the datepicker of the page, before the display of the calendar portion of one of the datepicker

ab.datepicker.opened

This event is triggered, bound for all the datepicker of the page, after the display of the calendar portion of one of the datepicker

ab.datepicker.closed

This event is triggered, bound for all the datepicker of the page, when the calendar portion of one of the datepicker is closed

↑ back to table of contents

Theming

  1. Give a name to your theme;
  2. Create a CSS file with the styles below, having replaced 'default' by the name of your theme. Use the properties 'color', 'background-color', 'border-color', .....
a.datepicker-button.default {
}
a.datepicker-button.default:hover,
a.datepicker-button.default:focus {
	background-color: #DDD;
}
div.datepicker-calendar.default {
	background-color: #FFF;
}
div.datepicker-calendar.default div.datepicker-month-wrap {
}
div.datepicker-calendar.default div.datepicker-month-fast-prev.disabled,
div.datepicker-calendar.default div.datepicker-month-fast-next.disabled ,
div.datepicker-calendar.default div.datepicker-month-prev.disabled,
div.datepicker-calendar.default div.datepicker-month-next.disabled {
	color:  #999;
}
div.datepicker-calendar.default div.datepicker-month-fast-prev.enabled:hover,
div.datepicker-calendar.default div.datepicker-month-fast-prev.enabled:focus,
div.datepicker-calendar.default div.datepicker-month-fast-next.enabled:hover,
div.datepicker-calendar.default div.datepicker-month-fast-next.enabled:focus,
div.datepicker-calendar.default div.datepicker-month-prev.enabled:hover,
div.datepicker-calendar.default div.datepicker-month-prev.enabled:focus,
div.datepicker-calendar.default div.datepicker-month-next.enabled:hover,
div.datepicker-calendar.default div.datepicker-month-next.enabled:focus,
div.datepicker-calendar.default div.datepicker-month:hover,
div.datepicker-calendar.default div.datepicker-month:focus,
div.datepicker-calendar.default button.datepicker-close:hover,
div.datepicker-calendar.default button.datepicker-close:focus {
	background-color: #EEE;
	border-color:  #999;
}
div.datepicker-calendar.default table.datepicker-grid:focus {
	outline: 1px dotted #999;
}
div.datepicker-calendar.default tr.datepicker-weekdays {
	border-top:  1px solid #999;
	border-bottom:  1px solid #999;
}
div.datepicker-calendar.default table.datepicker-grid th {
	background-color: #EEE;
	border:  none;
}
div.datepicker-calendar.default table.datepicker-grid td {
	border:  none;
	color: #000;
}
div.datepicker-calendar.default table.datepicker-grid td.unselectable {
	color: #999;
}
div.datepicker-calendar.default table.datepicker-grid td.curDay,
div.datepicker-calendar.default table.datepicker-grid td.curMonth,
div.datepicker-calendar.default table.datepicker-grid td.curYear {
	background-color: #FFF0C4;
}
div.datepicker-calendar.default table.datepicker-grid td.empty {
	border:  none;
	background-color: #F9F9F9;
}
div.datepicker-calendar.default table.datepicker-grid td.selectable:hover,
div.datepicker-calendar.default table.datepicker-grid td.selectable.focus {
	background-color: #DDD;
}
div.datepicker-calendar.default table.datepicker-grid td.empty:hover {
	background-color: #F9F9F9;
}
div.datepicker-calendar.default button.datepicker-close {
	background-color: #522A3F;
	color: #FFF;
	border-color:  #EEE;
}
  1. Add the CSS file to your page
  2. call the datepicker with the 'theme' option as follows :
$('your date selector').datepicker({
	............
	theme: 'the name of your theme',
	........
});

Keyboard interaction

  • Left Move focus to the previous day. Will move to the last day of the previous month, if the current day is the first day of a month.
  • Right Move focus to the next day. Will move to the first day of the following month, if the current day is the last day of a month.
  • Up Move focus to the same day of the previous week. Will wrap to the appropriate day in the previous month.
  • Down Move focus to the same day of the following week. Will wrap to the appropriate day in the following month.
  • PgUp Move focus to the same date of the previous month. If that date does not exist, focus is placed on the last day of the month.
  • PgDn Move focus to the same date of the following month. If that date does not exist, focus is placed on the last day of the month.
  • Alt+PgUp Move focus to the same date of the previous year. If that date does not exist (e.g leap year), focus is placed on the last day of the month.
  • Alt+PgDn Move focus to the same date of the following year. If that date does not exist (e.g leap year), focus is placed on the last day of the month.
  • Home Move to the first day of the month.
  • End Move to the last day of the month
  • Tab / Shift+Tab If the datepicker is in modal mode, navigate between calander grid and close/previous/next selection buttons, otherwise move to the field following/preceding the date textbox associated with the datepicker
  • Enter / Space Fill the date textbox with the selected date then close the datepicker widget.

↑ back to table of contents

ARIA 1.0 Markup

  • ARIA 1.0: [aria-activedescendant]
  • ARIA 1.0: [aria-atomic]
  • ARIA 1.0: [aria-controls]
  • ARIA 1.0: [aria-haspopup]
  • ARIA 1.0: [aria-hidden]
  • ARIA 1.0: [aria-invalid]
  • ARIA 1.0: [aria-labelledby]
  • ARIA 1.0: [aria-live]
  • ARIA 1.0: [aria-readonly]
  • ARIA 1.0: [aria-selected]
  • ARIA 1.0: [role="application"]
  • ARIA 1.0: [role="button"]
  • ARIA 1.0: [role="columnheader"]
  • ARIA 1.0: [role="grid"]
  • ARIA 1.0: [role="gridcell"]
  • ARIA 1.0: [role="heading"]

↑ back to table of contents

Browser Compatibility

  • osx: Chrome 10.0+
  • osx: Firefox 3.6+
  • osx: Opera 11.0+
  • osx: Safari 5.0+
  • win: Chrome 10.0+
  • win: Firefox 3.6+
  • win: Internet Explorer 8.0+
  • win: Opera 11.0+
  • win: Safari 5.0+

↑ back to table of contents

Copyright and license

© 2015-2019 Eureka2 - Jacques Archimède. Code released under the MIT license.

↑ back to table of contents

ab-datepicker's People

Contributors

ebenpack avatar eureka2 avatar gburghardt avatar mikevalenza2 avatar stsaklas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ab-datepicker's Issues

data[option] is not a function

I was wondering what I did incorrectly to receive this error on all the function calls on the datepicker. Like the disable and enable the datepicker.
In the view I have this textboxfor
@Html.TextBoxFor(m => m.DateTest, new { @class = "form-control datepicker", placeholder = "MM/dd/yyyy" })
In the document ready function i have this
$(document).ready(function (e) { //initialize date pickers $('.datepicker').datepicker(); });
yet when I write the line of code
$('#DateTest').datepicker('disable')
I get the error message uncaught type error: data[option] is not a function at jQuery.fn.init.$.fn.datepicker (datepicker.js:2940)
at :1:20

Based off of the demo it should be working to my knowledge. I'm not sure what I did incorrectly I do have the latest version 2.1.10 in the project

how can I change the input and out format to MMM d, yyyy

set
outputFormat: MMM d, yyyyt,
inputFormat: ["MMM d, yyyy"],

first time select a day no error. but re-select a day got the following error:
Cannot read property 'month_names_abbreviated' of undefined

any advise. thank you in advance!

When weekends are disabled , moving between months using left and right key skips complete month

There is a issue with moving between months using left and right key skips complete month when weekends are disabled.

Basically if one uses left arrow key and moves from one month (Jan 2018 )to previous month (Dec 2017), and the control falls on a weekend day of the previous month(Dec 31st 2017) , then using left arrow key completely skips the month (Dec 2017) to Nov 2017.

This happens only when weekends are disabled. Please see the attached screen shot document.
Kindly look in to it and provide a fix.
Screen_Cap.docx

Incorrect "headers" attribute on date table cells

In the rendered output, the table cells have somthing similar to the following header attribute::

<tr .. id="row5-date" ...>
  <td ... headers="row6-date Sunday" ...>11</td>
  <td ... headers="row6-date Monday" ...>12</td>
  ...
  <td ... headers="row6-date Saturday" ...>17</td>
</tr>

The row#_date is pointing to the wrong <tr> id. Also the Sunday value should be an ID, not the class applied on the thead tr td cells. The weekday header cells should have an ID for ARIA compliance.

These IDs should also be unique in the document (in case there are two datepickers instantiated)

date input field doens't diplay default value

Not sure what I did wrong.

the date input field doesn't display today's date default value when the page loaded. it displays format instead.
IE: MM-dd-yyyy
expect: 09-07-2017

But when I click on Calendar icon. it displays today's date. Any advise?

Thanks so much

Cannot read property 'top' of undefined

Getting the following error when clicking on the calendar icon: datepicker.js:2059 Uncaught TypeError: Cannot read property 'top' of undefined

Using jQuery 2.1.4 and Bootstrap 3.0.3

Calendar Icon <a> should be a <button> for accessibility reasons.

Hi there,

While you've added most of the workarounds (keyboard interactions and role=button), it would be simpler to just replace the with a in the template for the calendar picker element.

e.g.: replace:
= ['<a class="datepicker-button input-group-addon btn" role="button" aria-haspopup="true" tabindex="0" aria-labelledby="datepicker-bn-open-label-CALENDARID">', '\t<span class="glyphicon glyphicon-calendar" title="Select Date..."></span>', "</a>"]

with

= ['<button class="datepicker-button input-group-addon btn" aria-haspopup="true" tabindex="0" aria-labelledby="datepicker-bn-open-label-CALENDARID">', '\t<span class="glyphicon glyphicon-calendar" title="Select Date..."></span>', "</button>"]

This also avoids a sometimes conflict with bootstrap 3's calendar picker which can result in a keyboard trap.

adding today button & format

Hi,
I have couple questions.

  1. Is it possible/simply add today button in the bottom of the calendar?
  2. How to validate user type date in a correct format?

Thanks...

Enabled or disabled dates

Enable or disable specific dates, like "beforeShowDay” (Jquery) or “datesDisabled” (Bootstrap) ?.

it's possible?

How to disable datepicker?

Having trouble disabling the DatePicker here. I am able to disable the input field but the calender glyphicon will still open the picker when click on the calender glyphicon.

Basically, I want to calender glyphicon is not clickable when disable the input filed. Is this possible?

Selectable Grid focus indication

Greetings. Thank you for working on this project. I think I found an issue with your grid focus indication because in the current version, when focus shifts to the grid, any indication pretty much disappears until you move to another day using the arrow keys.

Using the blue theme, I found the issue (as I see it in the datepicker.css file). In fact, it seems to be this way in every theme, but each line that should provide focus has...

div.datepicker2-calendar.blue table.datepicker2-grid td.selectable:hover,
div.datepicker2-calendar.blue table.datepicker2-grid td.selectable.focus {
background-color: #0B6BA8;
color: #FFF;
border-color: #3484B7;
}

On the second entry, it ends with "td.selectable.focus" and I think it should end with "td.selectable:focus". Anyway, that fixed it for me and made the focus pop when switching into the grid itself. Again, it looks like it is this way throughout the css file, so they probably all need fixing.

Using public methods

Can you please clarify how the public methods can be used?

In the documentation you are mentioning this:

getDate
$('your date selector').datepicker('getDate');
Get the current Datepicker date object

But this throws an exception, the methods is not found in that object
VM9231:2944 Uncaught TypeError: data[option] is not a function
at n.fn.init.$.fn.datepicker (eval at webpackJsonp../node_modules/script-loader/addScript.js.module.exports (scripts.bundle.js:1), :2944:33)
at :1:36

Actually this is the object stored, and some methods are in proto

image

So I can only hide and show it by doing something like
$(".form-control.staticDateInput").data("ab.datepicker").proto.show.call($(".form-control.staticDateInput").data("ab.datepicker"))
or
$(".form-control.staticDateInput").data("ab.datepicker").proto.hide.call($(".form-control.staticDateInput").data("ab.datepicker"))

How can I use that method that was documented to get/set the date from code?

jQuery version: 2.2.4

Events not working

Hey there,

trying to implement custom color scheme for the datepicker, so I have to loop through all visible and enabled dates in order to assign css classes.

Tried to use the events opening and opened, but they don't seem to work.
I tried to do it like this:

$('#date').on('ab.datepicker.opening', function (datepicker) {
    console.log(datepicker);
});

Is this wrong? I don't get any errors it just does not execute.

Thanks in advance.
Best regards
Nick

Open calendar on fous in datepicker textbox

My requirement is to open calendar on focus event inside textbox instead of using calendar icon. Please suggest how can I achieve this. Because when i calling onfocus it is opening infinite time

Add Start Views for DOB

When input is a date of birth, it is convenient to start with the Year panel shown, then Month, followed by Day.

Thank you

non standard keyboard navigation

According to standard:
https://raw.githack.com/w3c/aria-practices/issue57-date-picker-design-pattern/aria-practices.html#calendar-grid-keyboard-interaction

  • Shift Page Up: Updates the calendar grid to the next year. instead of Alt+Page Up

  • Shift Page Down: Updates the calendar grid to the previous month. instead of Alt+Page Down

  • Home: Moves focus to first day of the current week. not to first day of current month

  • End: Moves focus to the last day of the current week. not to last day of current month

how to set date format like "Month D, Yr"

Hi,

Please let me know how can i set the date format like this "Month D, Yr" for ex: December 16, 2019.

I have tried with this : outputFormat: "MM"+" "+"dd"+", "+"yyyy"

i am getting like this "12 12, 2019"
actually I want the output like this "December 16, 2019"
please suggest me a solution

Ctrl+pageUp, Ctrl+pageDown not available in Chrome

Unfortunately, Ctrl+pageUp and Ctrl+pageDown are currently in use by Chrome (used for tab by tab navigation), and there is no way to hook into the combination before the browser takes that action. Would Shift+pageUp and Shift+pageDown be a better browser-agnostic solution for navigating a year at a time?

Can't tab out of the calendar

Hi,

Thanks for a great datepicker :)

I'm using it inline and I can't seem to tab out of the calendar. It seems the only way to tab out of the calendar is if there is another form element on the page otherwise, as a keyboard user, you're trapped

In my case I have 'Back' and 'Continue' buttons sitting under the calendar but it seems impossible to tab out of the calendar to these buttons.

I've managed to replicate this on your demo page by setting it to inline and removing all other input elements and adding a simple link after the calendar.

I hope this make sense and appreciate any help you might be able to offer.

Thanks

Accessibility: Required ARIA attribute not present: aria-level

The datepicker month button has role="heading" but missing aria-level attribute.
Either set role="button", or provide an option for setting aria-level, default to 1.

Title: WCAG 4.1.1,WCAG 4.1.2: Ensures elements with ARIA roles have all required ARIA attributes (#datepicker-month-date)
Tags: Accessibility, WCAG 4.1.1, WCAG 4.1.2, aria-required-attr

Issue: Ensures elements with ARIA roles have all required ARIA attributes (aria-required-attr - https://dequeuniversity.com/rules/axe/3.3/aria-required-attr?application=msftAI)

Target application: ab-datepicker - https://codepen.io/ambrosew/pen/PowKVZY

Element path: #iFrameKey-fe0f5c36-704c-05f4-e5ec-df87191795b4;#datepicker-month-date

Snippet: <div id="datepicker-month-date" class="datepicker-button datepicker-month" tabindex="0" role="heading" aria-live="assertive" aria-atomic="true" title="Click or press the Enter key or the spacebar to change the month">January 2020</div>

How to fix: 
Fix any of the following:
  Required ARIA attribute not present: aria-level

Environment: Chrome version 79.0.3945.117

====

This accessibility issue was found using Accessibility Insights for Web 2.13.1 (axe-core 3.3.2), a tool that helps find and fix accessibility issues. Get more information & download this tool at http://aka.ms/AccessibilityInsights.

TypeError: Cannot read property 'top' of undefined

Hi,
I am trying to use this date-picker because this one is accessible. But i am getting this error :
TypeError: Cannot read property 'top' of undefined

I have included all the dependencies. Please let me know if you can help me in this.

Thanks,
Zahra

ab-datepicker doesn't support Bootstrap Datepicker methods?

Either I'm doing something wrong, or there are a few methods that one can do with bootstrap-datepicker that you can't do with this datepicker? For example, I can't even figure out how to get the current date of the ab-datepicker. According to the bootstrap docs, you can do this:

$("#datepicker").datepicker('getDate')

But this is throwing a method not defined error on this datepicker.

Specifically, how do you do the following with this datepicker?

  1. Get the date
  2. Set the date (from javascript)
  3. Listen for updates to the date

I'm aware the README says how to use the 'onUpdate' method, but it isn't working for me. I have this piece of code:

$("#datepicker").datepicker("onUpdate", function (value) { console.log(value); });

But I get this error upon running the application:

2017-05-01 16_54_49-developer tools - chrome-extension___jlgikgiaohhillkfdndededbefacgohe_templates_

End date should be greater than start date

When user selects "today's date" as start date and when selecting the end date, user should not be allowed to select previous date(s). The user should be allowed to select later date.

Opening Modal View on a Modal

I tried to open calendar modal view in a popup modal but I am seeing inline view i.e. not able to see close button and modal view in a modal .

Is it some Issue or do I need to include some attribute ? Please Suggest .
Please find attached Screenshot which shows date-picker modal in a popup modal .

Using TAB to navigate datepicker

The user should be able to navigate between the header controls and the calendar grid by using tab/shift-tab.

Currently tab closes the control.

Extend Calendar View

How do I extend this calendar view to multiple months? say, I want to see two months or three months side by side.

Remove Focus

Hi. Is there a option to remove the focus in when the page load?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.