edilkamin
    Preparing search index...

    Function timeToIndex

    • Converts a day and time to a schedule array index.

      Parameters

      • day: number

        Day of week (0=Monday, 6=Sunday).

      • hour: number

        Hour of day (0-23).

      • minute: number

        Minute (0-59, will be rounded to nearest 30).

      Returns number

      • Index in the 336-element schedule array.
      // Monday 08:00
      timeToIndex(0, 8, 0); // Returns 16
      // Wednesday 14:30
      timeToIndex(2, 14, 30); // Returns 125