幾個有用的JS 去空 返回兩日期之差

2021-08-22 11:16:09 字數 673 閱讀 2717

去空

string.prototype.trim = function() /*

功能:返回兩日期之差

* type:

返回類別標識

.yy:

年,mm:

月,ww:

周,dd:

日,hh:

小時,mi:

分,ss:

秒,ms:

毫秒* intorfloat :

返回整型還是浮點型值

0:整型

,不等於

0:浮點型

* output :

輸出提示,如

:時間差為

#* example:

* var date1=new date("2006","03","01");

* var date2=new date("2006","04","01");

* date2.datediff(date1,"dd","0",null)

返回值為

30*/

date.prototype.datediff = function (date,type,intorfloat,output)

switch(type)

return (output ? output.replace(/#/g," "+num+" ") : num);}

幾個有用的巨集

分類 c c 1.列印錯誤資訊 如果程式的執行必須要求某個巨集被定義,在檢查到巨集沒有被定義是可以使用 error,warning列印錯誤 警告 資訊,如 ifndef unix error this section will only work on unix systems endif 只有 u...

幾個有用的巨集

1.列印錯誤資訊 如果程式的執行必須要求某個巨集被定義,在檢查到巨集沒有被定義是可以使用 error,warning列印錯誤 警告 資訊,如 ifndef unix error this section will only work on unix systems endif 只有 unix 巨集被...

Xmind幾個有用的技巧

xmind是乙個很好的思維導圖工具,是學習研究總結的好幫手。xmind功能很豐富,這裡只是簡要列出幾個比較有用的技巧。選中乙個xmind元素 專業名詞叫 主題 後,一般在右下角會出現 屬性 如果你不想老是看到單調的格式,一定要善用屬性。具體細節就選中乙個xmind元素,自己試試吧!這個問題曾經讓筆者...