|
@@ -17,6 +17,8 @@ function throttle(fn, time) {
|
|
|
}
|
|
|
|
|
|
const periodReg = /\d{4}-((0[1-9])|(1[0-2]))$/;
|
|
|
+const quaterReg = /\d{4}年-[一二三四]{1}季度$/;
|
|
|
+
|
|
|
function createLib() {
|
|
|
const name = $('#name').val();
|
|
|
if (!name) {
|
|
@@ -24,7 +26,7 @@ function createLib() {
|
|
|
return false;
|
|
|
}
|
|
|
const period = $('#period').val();
|
|
|
- if (!period || !periodReg.test(period)) {
|
|
|
+ if (!period || (!periodReg.test(period) && !quaterReg.test(period))) {
|
|
|
$('#period-error').show();
|
|
|
return false;
|
|
|
}
|