Skip to content

Lengths of 15 and 45 Minutes are Not Supported #10

@Whobeu

Description

@Whobeu

The code in same-validator.js does not properly check for 15 minute lengths when the hour is less than 1. The current code is:

if (hr <= 1 && (mn % 15 !== 0)) {
    return false;
}

If the value of mn is 15 or 45, the test does not return false but it does not return true either. The code then proceeds to the next check and returns false on the following statement:

if (mn % 30 !== 0) {
  return false;
}

I changed the 15 minute increment check in my implementation to the following which is working fine in my code:

if (hr < 1) return (mn % 15 === 0);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions