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

Can't add multiple disabledTime Intervals ? #44

Open
saeed-sikandar opened this issue Dec 7, 2022 · 3 comments
Open

Can't add multiple disabledTime Intervals ? #44

saeed-sikandar opened this issue Dec 7, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@saeed-sikandar
Copy link

I want to disabled multiple time slots like

'09:00 AM - 09:30 AM' , '10:00 AM - 10:30 AM'
like I want to disable above to time slots from 9 am to 9 30 am and 10 am to 10 30 am , and like above I have just 2 time slots but can have multiple slots
how do I add multiple disabledTime intervals as it's the string below is my code

import { TimepickerUI } from "timepicker-ui";




const basic = document.querySelector(".basic");
const options = {
   // currentTime: {
   //     updateInput: true,
   //     locales: "en-US",
   //     preventClockType: false
   // },
   clockType: "12h",
   theme: "basic",
   incrementMinutes: 15,
   disabledTime: {
       interval: '10:00 AM - 10:30 AM',
       interval: '10:00 AM - 10:30 AM',
   },
  
   // mobile: true,
};
const basicPicker = new TimepickerUI(basic, options);
basicPicker.create();

  
@pglejzer
Copy link
Owner

pglejzer commented Dec 7, 2022

Hello, thank you for you topic, I think it's a bug with these intervals. I will try to fix this and probably I will change logic of properties about that. These intervals strings are not intuitive.

@pglejzer pglejzer added the bug Something isn't working label Dec 7, 2022
@pglejzer pglejzer self-assigned this Dec 7, 2022
@saeed-sikandar
Copy link
Author

saeed-sikandar commented Dec 8, 2022

Ohh thanks then and let me tell you I also tried another way but then, The first time interval 09:00 AM - 09:30 AM was ignored and it disabled the last time interval from 10:00 AM - 10:30 AM

Just to inform you ....

import { TimepickerUI } from "timepicker-ui";




const basic = document.querySelector(".basic");
const options = {
   
    clockType: "12h",
    theme: "basic",
    incrementMinutes: 15,
    disabledTime: {
        interval: '09:00 AM - 09:30 AM,10:00 AM - 10:30 AM ',
    },

};
const basicPicker = new TimepickerUI(basic, options);
basicPicker.create();


@AustinLinares
Copy link

Good afternoon @pglejzer,
I saw that a future feature is "max/min time options" but maybe You could allow an array of strings(formatted as you mention in the readme file) as "interval" value. So We can add as many intervals as we need and that also works as max and min values.
Also, is there a way of work with this project locally? If it is, I'll appreciate the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants