Logos DX
    Preparing search index...

    Function months

    • Creates a duration in months (converted to milliseconds).

      WHY: Provides a more readable way to specify durations in months. Uses 30.4 days as average month length for accuracy.

      Parameters

      • n: number

        number of months

      Returns number

      milliseconds equivalent (rounded)

      const subscriptionExpiry = months(1);  // 1 month subscription
      setTimeout(fn, months(3)); // Quarterly task