I want to format a date time like this:
yyyy-MM-dd hh:mm:ss
if I return a string is like this:
2016-07-02 20:14:12
some code is like this(all code is here):
let token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g;
mask.replace(token, (match) => {
if (match in flags) {
return flags[match];
}
return match.slice(1, match.length - 1);
});
The problem is now I want the number is wrapped by React.Component, such as:
<span>2016</span>-<span>07</span>-<span>02</span> <span>20</span>:<span>14</span>:<span>12</span>
I want to point out that the wrapped element is not always span, maybe a component defined by myself, such as MyComponent
maskdefined?