Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to enable especific days #98

merged 1 commit into from May 4, 2016


Copy link

Gabrielr47 commented May 3, 2016

If you want to choose witch days will be enable Is just to put on the options.

      time: false,
      clearButton: true,
      enableDays: [3, 5]


Add on the plugin:

enableDays: function() {
  var enableDays = this.params.enableDays;
  if (enableDays) {
    $(".dtp-picker-days tbody tr td").each(function() {
      if (!(($.inArray($(this).index(), enableDays)) >= 0)) {
          "background": "#e3e3e3",
          "cursor": "no-drop",
          "opacity": "0.5"

Then Just init on the focus event :)

now you can just add the days that you need to display like:   enableDays: [3, 5] in the options param

This comment has been minimized.

Copy link

T00rk commented May 4, 2016

Nice job, can you just change the background of disabled days and set it to white please ?


This comment has been minimized.

Copy link
Contributor Author

Gabrielr47 commented May 4, 2016


The pattern background is white, I put gray to be clear that was disabled.
If white will be better just remove the line with:"background": "#e3e3e3",

@T00rk T00rk merged commit c506107 into T00rk:gh-pages May 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.