Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2035
Limit minutes to 15 minute intervals?
posted

Is it possible to limit the input to 15 minute intervals?  e.g. 8:15, 8:30, 8:45, etc.

Regards,

Arthur

Parents
No Data
Reply
  • 1100
    Offline posted

    Hello Arthur,

    Thank you for using Infragistics Ignite UI!

    I can suggest two approaches to achieve the desired behavior.

    The first one is related to a change that is made in the “spinDelta” option of the editor. Since version 2017.2 this option can be set to an object, meaning that you can set spin deltas for years, months, days, hours, minutes, etc.

    It looks like this:

    //Initialize with object

    $(".selector").igDateEditor({

        spinDelta: {

            minutes: 15    

        }

    });

    In this case, when the user is spinning through the minute’s section, the minutes will change in 15-minutes interval.

    If this would be of help – you can get the igEditors source from GitHub as the editors are a part of the OSS version of Ignite UI -> https://github.com/IgniteUI/ignite-ui

    However, have in mind that this will not prevent the user from entering a different value, using the keyboard. To handle this – you would need some custom logic. I can suggest something like this:

    You can get the value of the minutes with something similar to

    $(".selector").igDateEditor("value").getMinutes();

    After you have the minutes, you can divide them to 15 to verify that the number is even. And if the number is not even – you can show a message that the value is not passing validation.

    I hope those ideas will help you in your project.

    If you have any other questions, do not hesitate to contact me again.

    Thank you once more for choosing Infragistics Ignite UI!

    Regards,
    Alexander Marinov,
    Infragistics

Children
No Data