DatejsJavaScript日期庫
Date.js 是一個開源的JavaScript庫,用來解析、格式化和處理日期數(shù)據(jù),支持多種語言的日期格式處理。
示例代碼:
Date.today() // Returns today's date, with time set to 00:00 (start of day).
Date.today().next().friday() // Returns the date of the next Friday.
Date.today().last().monday() // Returns the date of the previous Monday.
new Date().next().march() // Returns the date of the next March.
new Date().last().week() // Returns the date one week ago.
Date.today().is().friday() // Returns true|false if the day-of-week matches.
Date.today().is().fri() // Abbreviated day names.
Date.today().is().november() // Month names.
Date.today().is().nov() // Abbreviated month names.
評論
圖片
表情
