You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.4 KiB
58 lines
1.4 KiB
/**
|
|
* date转化为hh:mm
|
|
*/
|
|
export function dateToStr(date) {
|
|
if (typeof date !== 'number') {
|
|
return ''
|
|
}
|
|
date = new Date(date)
|
|
let hh = date.getHours()
|
|
let mm = date.getMinutes()
|
|
if (hh<10) {
|
|
hh = '0' + hh
|
|
}
|
|
if (mm<10) {
|
|
mm = '0' + mm
|
|
}
|
|
return hh + ':' + mm
|
|
}
|
|
export function traditionalized(cc){
|
|
var str='';
|
|
if (cc) {
|
|
for(var i=0;i<cc.length;i++){
|
|
if(simpPYStr().indexOf(cc.charAt(i))!=-1)
|
|
str+=ftPYStr().charAt(simpPYStr().indexOf(cc.charAt(i)));
|
|
else if(qqPYStr().indexOf(cc.charAt(i))!=-1)
|
|
str+=ftPYStr().charAt(qqPYStr().indexOf(cc.charAt(i)));
|
|
else
|
|
str+=cc.charAt(i);
|
|
}
|
|
}
|
|
return str;
|
|
}
|
|
export function simplized(cc){
|
|
var str='';
|
|
if (cc) {
|
|
for(var i=0;i<cc.length;i++){
|
|
if(ftPYStr().indexOf(cc.charAt(i))!=-1)
|
|
str+=simpPYStr().charAt(ftPYStr().indexOf(cc.charAt(i)));
|
|
else if(qqPYStr().indexOf(cc.charAt(i))!=-1)
|
|
str+=simpPYStr().charAt(qqPYStr().indexOf(cc.charAt(i)));
|
|
else
|
|
str+=cc.charAt(i);
|
|
}
|
|
}
|
|
return str;
|
|
}
|
|
function qqlized(cc){
|
|
var str='';
|
|
for(var i=0;i<cc.length;i++){
|
|
if(ftPYStr().indexOf(cc.charAt(i))!=-1)
|
|
str+=qqPYStr().charAt(ftPYStr().indexOf(cc.charAt(i)));
|
|
else if(simpPYStr().indexOf(cc.charAt(i))!=-1)
|
|
str+=qqPYStr().charAt(simpPYStr().indexOf(cc.charAt(i)));
|
|
else
|
|
str+=cc.charAt(i);
|
|
}
|
|
return str;
|
|
}
|
|
|