codetrix - v1.5.0
    Preparing search index...

    Function setDay

    • Sets the day of the month and returns a new Date instance.

      Parameters

      • date: Date

        The original date.

      • day: number

        The day of the month to set.

      Returns Date

      A new Date with the updated day.

      setDay(new Date('2025-01-01'), 15); // → 2025-01-15