JavaScript日期庫 Datejs
Datejs 是一個開源的JavaScript庫,用來解析、格式化和處理日期數據,支持多種語言的日期格式處理。
示例代碼:
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.
本文由用戶 fmms 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!