mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-07 11:17:56 +08:00
5aa50d35d7
- Multi-AI competition mode (Qwen vs DeepSeek) - Binance Futures integration - AI self-learning mechanism - Professional web dashboard - Complete risk management system
32 lines
750 B
JavaScript
32 lines
750 B
JavaScript
import { toDate } from "./toDate.js";
|
|
|
|
/**
|
|
* The {@link isWeekend} function options.
|
|
*/
|
|
|
|
/**
|
|
* @name isWeekend
|
|
* @category Weekday Helpers
|
|
* @summary Does the given date fall on a weekend?
|
|
*
|
|
* @description
|
|
* Does the given date fall on a weekend? A weekend is either Saturday (`6`) or Sunday (`0`).
|
|
*
|
|
* @param date - The date to check
|
|
* @param options - An object with options
|
|
*
|
|
* @returns The date falls on a weekend
|
|
*
|
|
* @example
|
|
* // Does 5 October 2014 fall on a weekend?
|
|
* const result = isWeekend(new Date(2014, 9, 5))
|
|
* //=> true
|
|
*/
|
|
export function isWeekend(date, options) {
|
|
const day = toDate(date, options?.in).getDay();
|
|
return day === 0 || day === 6;
|
|
}
|
|
|
|
// Fallback for modularized imports:
|
|
export default isWeekend;
|