Blame view

天文台pc/tianwentai-ui/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.mjs 435 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  import { constructFrom } from "../../../constructFrom.mjs";
  import { Parser } from "../Parser.mjs";
  import { parseAnyDigitsSigned } from "../utils.mjs";
  
  export class TimestampSecondsParser extends Parser {
    priority = 40;
  
    parse(dateString) {
      return parseAnyDigitsSigned(dateString);
    }
  
    set(date, _flags, value) {
      return [constructFrom(date, value * 1000), { timestampIsSet: true }];
    }
  
    incompatibleTokens = "*";
  }