Add more DatePicker tests
This commit is contained in:
parent
3747aecd53
commit
db1b716f29
2 changed files with 119 additions and 1 deletions
|
@ -57,6 +57,16 @@ exports.createTest = function(Compo, propsData = {}, mounted = false) {
|
|||
return new Ctor({ propsData }).$mount(mounted === false ? null : elm);
|
||||
};
|
||||
|
||||
/**
|
||||
* Transform Date string (yyyy-mm-dd hh:mm:ss) to Date object
|
||||
* @param {String}
|
||||
*/
|
||||
exports.stringToDate = function(str) {
|
||||
const parts = str.split(/[^\d]/).filter(Boolean);
|
||||
parts[1] = parts[1] - 1;
|
||||
return new Date(...parts);
|
||||
};
|
||||
|
||||
/**
|
||||
* 触发一个事件
|
||||
* mouseenter, mouseleave, mouseover, keyup, change, click 等
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue