MCPcopy
hub / github.com/Bistutu/FluentRead / parseDateOrFalse

Function parseDateOrFalse

userscripts.js:1651–1657  ·  view source on GitHub ↗
(dateString)

Source from the content-addressed store, hash-verified

1649
1650// 验证并解析日期格式,如果格式不正确则返回false
1651function parseDateOrFalse(dateString) {
1652 // 正则表达式,用于检查常见的日期格式(如 YYYY-MM-DD)
1653 if (!regex.combinedDateRegex.test(dateString)) return false;
1654 // 尝试解析日期,如果无效返回 false
1655 const date = new Date(dateString);
1656 return !isNaN(date.getTime()) ? date : false;
1657}
1658
1659// 判断字符串是否不包含中文
1660function withoutChinese(text) {

Callers 2

procOpenaiFunction · 0.85
procMavenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected