- 博客(3)
- 收藏
- 关注
原创 前端正则校验 手机号,身份证,数字,邮箱。。。
* 手机号校验规则 (工信部2019年最新公布)/**手机号正则*/export const phoneRule = /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/;/**手机号校验*/export const phoneFun = (params) => { const regex = new RegExp(.
2022-04-20 16:30:14
1464
1
原创 星期阿拉伯数字转成中文
/**阿拉伯数字 星期数转中文 */function SectionToChinese(traget) { /**获取时间 */ const date = traget ? new Date(traget) : new Date(); /**获取星期 */ const currentWeek = date.getDay(); let result = '' switch(currentWeek) { case 0: .
2022-04-20 16:03:11
398
原创 类似微信聊天 日期算法(转换)
微信聊天日期转换 * IOS 时间 有bug需要兼容: '2022-12-12' ==> '2022/12/12' * 每周的第一天是 周天~/**获取当月第几周 */function getMonthWeek(Date){ let theSaturday = Date.getDate() + (6 - Date.getDay()); return Math.ceil(theSaturday / 7);}/** 判断iOS*/cons...
2022-04-20 15:49:32
965
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人