验证中...
Validators.js
Raw Copy
'use strict'
exports.isValidDateString = (dateString) => {
var regex = /^\d{4}-\d{2}-\d{2}$/
if (regex.test(dateString)) {
var dt = Date.parse(dateString)
return !isNaN(dt)
} else {
return false
}
}
exports.isValidPageSizeString = (intString) => {
var regex = /^[1-9]\d*$/
return regex.test(intString)
}
exports.isValidPageIndexString = (intString) => {
var regex = /^[1-9]\d*|0$/
return regex.test(intString)
}
exports.isValidStockCode = (code) => {
var regex = /^(((30)|(00))\d{4}\.SZ)|(60\d{4}\.SH)|(200\d{3}\.SZ)|(900\d{3}\.SH)$/
return regex.test(code)
}

Comment list( 0 )

You need to Sign in for post a comment

Help Search

Gitee_you_jiang_zheng_wen Zheng_wen_close