Skip to content

Instantly share code, notes, and snippets.

View shuise's full-sized avatar
💭
coding

RiverRunning shuise

💭
coding
View GitHub Profile
<!doctype html>
<html>
<head>
<!-- Encoding -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></meta>
@shuise
shuise / any format time
Created November 29, 2011 01:42
any format time
getDate : function(model,time) {
var time = time || new Date();
var z ={y:time.getFullYear(),
M:time.getMonth()+1,
d:time.getDate(),
h:time.getHours(),
m:time.getMinutes(),
s:time.getSeconds()
};
return model.replace(/(y+|M+|d+|h+|m+|s+)/g,function(v) {
function copy(a, b, isWrite, filter){
for (var prop in b)
if (isWrite || typeof a[prop] === 'undefined' || a[prop] === null)
a[prop] = filter ? filter(b[prop]) : b[prop];
return a;
}