api
This commit is contained in:
Binary file not shown.
@@ -5,6 +5,7 @@ const common = {
|
||||
* @return { String } 处理好的富文本
|
||||
*/
|
||||
unescapeHTML(temp){
|
||||
if(!temp) return '';
|
||||
temp = "" + temp;
|
||||
return temp.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'");
|
||||
},
|
||||
@@ -16,6 +17,7 @@ const common = {
|
||||
* @return { String } 格式化日期
|
||||
*/
|
||||
timestampToDate({timestamp, spacer = '-', end = 'day'} = {}) {
|
||||
if(!timestamp) return '';
|
||||
const newDate = new Date(parseInt(timestamp) * 1000);
|
||||
// const year = newDate.getUTCFullYear();
|
||||
const year = newDate.getFullYear();
|
||||
|
||||
Reference in New Issue
Block a user