mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-09 14:00:57 +08:00
Initial commit: NOFX AI Trading System
- Multi-AI competition mode (Qwen vs DeepSeek) - Binance Futures integration - AI self-learning mechanism - Professional web dashboard - Complete risk management system
This commit is contained in:
31
web/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js
generated
vendored
Normal file
31
web/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
import { numericPatterns } from "../constants.js";
|
||||
import { Parser } from "../Parser.js";
|
||||
|
||||
import { parseNDigits, parseNumericPattern } from "../utils.js";
|
||||
|
||||
export class Hour1To24Parser extends Parser {
|
||||
priority = 70;
|
||||
|
||||
parse(dateString, token, match) {
|
||||
switch (token) {
|
||||
case "k":
|
||||
return parseNumericPattern(numericPatterns.hour24h, dateString);
|
||||
case "ko":
|
||||
return match.ordinalNumber(dateString, { unit: "hour" });
|
||||
default:
|
||||
return parseNDigits(token.length, dateString);
|
||||
}
|
||||
}
|
||||
|
||||
validate(_date, value) {
|
||||
return value >= 1 && value <= 24;
|
||||
}
|
||||
|
||||
set(date, _flags, value) {
|
||||
const hours = value <= 24 ? value % 24 : value;
|
||||
date.setHours(hours, 0, 0, 0);
|
||||
return date;
|
||||
}
|
||||
|
||||
incompatibleTokens = ["a", "b", "h", "H", "K", "t", "T"];
|
||||
}
|
||||
Reference in New Issue
Block a user