MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / monthIndex

Function monthIndex

host/time/src/main/fmt.js:36–39  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

34const ascForm = (t) => `${DAYS_ABBR[jsDay(t[6])]} ${MONTHS_ABBR[t[1] - 1]} ${String(t[2]).padStart(2, " ")} ${pad(t[3])}:${pad(t[4])}:${pad(t[5])} ${t[0]}`;
35
36const monthIndex = (name) => {
37 const full = MONTHS.findIndex((m) => m.toLowerCase() === name.toLowerCase());
38 return full >= 0 ? full : MONTHS_ABBR.findIndex((m) => m.toLowerCase() === name.toLowerCase());
39};
40
41// Compile the format into a regex, capture fields, assemble a struct_time JSON.
42const STRP = { Y: "(\\d{4})", y: "(\\d{2})", m: "(\\d{1,2})", d: "(\\d{1,2})", H: "(\\d{1,2})", M: "(\\d{1,2})", S: "(\\d{1,2})", j: "(\\d{1,3})", b: "([A-Za-z]+)", B: "([A-Za-z]+)", a: "([A-Za-z]+)", A: "([A-Za-z]+)" };

Callers 1

strptimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected