• Resolved mjunes

    (@mjunes)


    Hello,

    I think I’ve found a bug with the datetime field, specifically minutes field. I have set the min and max minutes (00-11) but the field still shows all the minutes (00-59). However, the hour field works properly. Please find the url of the page in the pastebin below.

    https://pastebin.com/EtWtuFbK

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @mjunes,

    It is not an issue, the min and max in the minutes are referring to the time as a whole. For example, if you define the time from 3 hours and 15 minutes (as min) to 14 hours and 30 minutes (as max), the form will show a validation error if you select any time before the 3:15 or after 14:30, but you can select 4:01 or 12:59 (or any other time into the interval), both are valid because they are into the range (from 3:15 to 14:30)

    What behavior do you want exactly?

    Best regards.

    Thread Starter mjunes

    (@mjunes)

    Hello again,

    Thanks for the clarification. I need the minutes to show only the values between the min and max minutes. for example: If i set min value to 00 and max value to 11, I want it to show only 00,01,02,03,04,05,06,07,08,09,10,11 and nothing else.

    Plugin Author codepeople

    (@codepeople)

    Hello,

    In this case you simply should insert a “HTML Content” field in the form with the following piece of code as its content:

    
    <script>fbuilderjQuery(document).one('showHideDepEvent', function(){
    fbuilderjQuery('.minutes-component option').each(function(){if(11 < this.value*1)fbuilderjQuery(this).remove();});
    });</script>
    

    and that’s all.
    Best regards.

    Thread Starter mjunes

    (@mjunes)

    Thank you. It works.

    Thread Starter mjunes

    (@mjunes)

    Hello again,

    How to make the minutes field to display only certain values (5,10,15 and 20)?

    Thanks.

    Plugin Author codepeople

    (@codepeople)

    Hello @mjunes,

    In the current version of the plugin you can decide the intervals to apply in the DropDown for the minutes through the attribute: “steps for minutes” in the field’s settings. For example, entering the number five into this attribute, the possible values to select would: 0,5,10,15,….

    If you want to include only some options you should run your own script for removing all <option> tags in the DropDown for the minutes whose values does not match with the list you want.

    For example, assuming you want to delete the option whose value is 01, a possible solution would be run the code:

    
    jQuery('[id*="_minutes"] option[value="01"]').remove();
    

    Best regards.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Minutes Field doesn’t work properly’ is closed to new replies.