weekdayRange.d.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import { GMT, Weekday } from './index';
  2. /**
  3. * Only the first parameter is mandatory. Either the second, the third, or both
  4. * may be left out.
  5. *
  6. * If only one parameter is present, the function yeilds a true value on the
  7. * weekday that the parameter represents. If the string "GMT" is specified as
  8. * a second parameter, times are taken to be in GMT, otherwise in local timezone.
  9. *
  10. * If both wd1 and wd1 are defined, the condition is true if the current weekday
  11. * is in between those two weekdays. Bounds are inclusive. If the "GMT" parameter
  12. * is specified, times are taken to be in GMT, otherwise the local timezone is
  13. * used.
  14. *
  15. * Valid "weekday strings" are:
  16. *
  17. * SUN MON TUE WED THU FRI SAT
  18. *
  19. * Examples:
  20. *
  21. * ``` js
  22. * weekdayRange("MON", "FRI")
  23. * true Monday trhough Friday (local timezone).
  24. *
  25. * weekdayRange("MON", "FRI", "GMT")
  26. * same as above, but GMT timezone.
  27. *
  28. * weekdayRange("SAT")
  29. * true on Saturdays local time.
  30. *
  31. * weekdayRange("SAT", "GMT")
  32. * true on Saturdays GMT time.
  33. *
  34. * weekdayRange("FRI", "MON")
  35. * true Friday through Monday (note, order does matter!).
  36. * ```
  37. *
  38. *
  39. * @param {String} wd1 one of the weekday strings.
  40. * @param {String} wd2 one of the weekday strings.
  41. * @param {String} gmt is either the string: GMT or is left out.
  42. * @return {Boolean}
  43. */
  44. export default function weekdayRange(wd1: Weekday, wd2?: Weekday | GMT, gmt?: GMT): boolean;
  45. //# sourceMappingURL=weekdayRange.d.ts.map