1.0.0 • Published 3 years ago

my_test_date_format v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

导入

const itCode = require('it_code');

格式化时间

// 调用format对时间格式化
const distr = itCode.dateFormat(new Date());

转义 html中的特殊字符

// 调用format对时间格式化
const htmlStr = '<h1 title='abc'>这是h1标签<span>asdf&nbsp;</span></h1>';
const str = itCode.htmlEscape(htmlStr);

还原转义字符html

// 调用format对时间格式化
const htmlStr = '&lt;h1 title='abc'&gt;这是h1标签&lt;span&gt;asdf&nbsp;&lt;/span&gt;&lt;/h1&gt;';
const str = itCode.htmlUnEscape(htmlStr);

开源协议

ISC