欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

一文秒懂js如何快速處理日期以及手寫Day.js

 更新時間:2024年06月20日 10:09:34   作者:碼農(nóng)白衣  
Day.js是一個輕量的處理時間和日期的JavaScript庫,和Moment.js的API設(shè)計保持完全一樣,這篇文章主要給大家介紹了關(guān)于js如何快速處理日期以及手寫Day.js的相關(guān)資料,需要的朋友可以參考下

一、Day.js介紹

1.Day.js的概念

   Day.js 是一個輕量級的 JavaScript 日期庫,用于解析、操作和格式化日期和時間。它的設(shè)計靈感來自于 Moment.js,但相比于 Moment.js,Day.js 更小巧、性能更好,并且提供了更現(xiàn)代化的 API。

2.Day.js的特點(diǎn)及功能

  • 日期解析和格式化

    • Day.js 提供了 parse 方法用于解析字符串形式的日期,并將其轉(zhuǎn)換為 Day.js 的日期對象。
    • 使用 format 方法可以將日期對象格式化為特定的日期字符串,支持自定義格式化模板。
  • 日期操作

    • Day.js 提供了一系列方法用于增減年、月、日、小時、分鐘、秒等時間單位,如 add、subtract 等方法。
    • 還提供了諸如 startOf、endOf 等方法,用于將日期設(shè)置為指定時間單位的起始或結(jié)束。
  • 日期比較

    • Day.js 提供了 isBeforeisSame、isAfter 等方法,用于比較兩個日期的先后順序或是否相同。
  • 鏈?zhǔn)讲僮?/strong>:

    • Day.js 支持鏈?zhǔn)秸{(diào)用方法,可以在同一個語句中連續(xù)調(diào)用多個方法,從而實(shí)現(xiàn)更復(fù)雜的日期操作。
  • 國際化支持

    • Day.js 支持國際化,可以根據(jù)不同的語言和地區(qū),格式化日期字符串和輸出本地化的日期表示。
  • 插件系統(tǒng)

    • Day.js 提供了簡單的插件系統(tǒng),允許開發(fā)者擴(kuò)展其功能或添加新的特性,以滿足項(xiàng)目的特定需求。
  • 不可變性

    • Day.js 的日期對象是不可變的,一旦創(chuàng)建了日期對象,就無法直接修改它,這有助于避免副作用帶來的潛在問題。
  • 格式化

    • Day.js 具有豐富的格式化選項(xiàng),可以根據(jù)需求輸出日期和時間的各種格式,如年、月、日、小時、分鐘、秒等。
  • 時區(qū)和夏令時

    • Day.js 可以處理時區(qū)和夏令時的問題,使得在跨時區(qū)和跨國界的應(yīng)用中更加可靠和靈活。

 二、Day.js的使用

首先可以到Day.js中文網(wǎng)查看官方文檔,了解使用說明

1.獲取使用

要在您的 Node.js 項(xiàng)目中使用 Day.js,只需使用 npm (opens new window) 安裝,或 cnpm (opens new window) 安裝,或 yarn (opens new window) 安裝,或 pnpm (opens new window) 安裝

npm install dayjs
cnpm install dayjs -S
yarn add dayjs
pnpm add dayjs

然后在項(xiàng)目代碼中引入即可:

var dayjs = require('dayjs')
// import dayjs from 'dayjs' // ES 2015
dayjs().format()

2.本地使用

本地存儲dayjs庫進(jìn)行使用

!function (t, n) { "object" == typeof exports && "undefined" != typeof module ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t.dayjs = n() }(this, function () { "use strict"; var t = "millisecond", n = "second", e = "minute", r = "hour", i = "day", s = "week", u = "month", o = "quarter", a = "year", h = /^(\d{4})-?(\d{1,2})-?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/, f = /\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, c = function (t, n, e) { var r = String(t); return !r || r.length >= n ? t : "" + Array(n + 1 - r.length).join(e) + t }, d = { s: c, z: function (t) { var n = -t.utcOffset(), e = Math.abs(n), r = Math.floor(e / 60), i = e % 60; return (n <= 0 ? "+" : "-") + c(r, 2, "0") + ":" + c(i, 2, "0") }, m: function (t, n) { var e = 12 * (n.year() - t.year()) + (n.month() - t.month()), r = t.clone().add(e, u), i = n - r < 0, s = t.clone().add(e + (i ? -1 : 1), u); return Number(-(e + (n - r) / (i ? r - s : s - r)) || 0) }, a: function (t) { return t < 0 ? Math.ceil(t) || 0 : Math.floor(t) }, p: function (h) { return { M: u, y: a, w: s, d: i, D: "date", h: r, m: e, s: n, ms: t, Q: o }[h] || String(h || "").toLowerCase().replace(/s$/, "") }, u: function (t) { return void 0 === t } }, $ = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_") }, l = "en", m = {}; m[l] = $; var y = function (t) { return t instanceof v }, M = function (t, n, e) { var r; if (!t) return l; if ("string" == typeof t) m[t] && (r = t), n && (m[t] = n, r = t); else { var i = t.name; m[i] = t, r = i } return e || (l = r), r }, g = function (t, n, e) { if (y(t)) return t.clone(); var r = n ? "string" == typeof n ? { format: n, pl: e } : n : {}; return r.date = t, new v(r) }, D = d; D.l = M, D.i = y, D.w = function (t, n) { return g(t, { locale: n.$L, utc: n.$u, $offset: n.$offset }) }; var v = function () { function c(t) { this.$L = this.$L || M(t.locale, null, !0), this.parse(t) } var d = c.prototype; return d.parse = function (t) { this.$d = function (t) { var n = t.date, e = t.utc; if (null === n) return new Date(NaN); if (D.u(n)) return new Date; if (n instanceof Date) return new Date(n); if ("string" == typeof n && !/Z$/i.test(n)) { var r = n.match(h); if (r) return e ? new Date(Date.UTC(r[1], r[2] - 1, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, r[7] || 0)) : new Date(r[1], r[2] - 1, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, r[7] || 0) } return new Date(n) }(t), this.init() }, d.init = function () { var t = this.$d; this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds() }, d.$utils = function () { return D }, d.isValid = function () { return !("Invalid Date" === this.$d.toString()) }, d.isSame = function (t, n) { var e = g(t); return this.startOf(n) <= e && e <= this.endOf(n) }, d.isAfter = function (t, n) { return g(t) < this.startOf(n) }, d.isBefore = function (t, n) { return this.endOf(n) < g(t) }, d.$g = function (t, n, e) { return D.u(t) ? this[n] : this.set(e, t) }, d.year = function (t) { return this.$g(t, "$y", a) }, d.month = function (t) { return this.$g(t, "$M", u) }, d.day = function (t) { return this.$g(t, "$W", i) }, d.date = function (t) { return this.$g(t, "$D", "date") }, d.hour = function (t) { return this.$g(t, "$H", r) }, d.minute = function (t) { return this.$g(t, "$m", e) }, d.second = function (t) { return this.$g(t, "$s", n) }, d.millisecond = function (n) { return this.$g(n, "$ms", t) }, d.unix = function () { return Math.floor(this.valueOf() / 1e3) }, d.valueOf = function () { return this.$d.getTime() }, d.startOf = function (t, o) { var h = this, f = !!D.u(o) || o, c = D.p(t), d = function (t, n) { var e = D.w(h.$u ? Date.UTC(h.$y, n, t) : new Date(h.$y, n, t), h); return f ? e : e.endOf(i) }, $ = function (t, n) { return D.w(h.toDate()[t].apply(h.toDate(), (f ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(n)), h) }, l = this.$W, m = this.$M, y = this.$D, M = "set" + (this.$u ? "UTC" : ""); switch (c) { case a: return f ? d(1, 0) : d(31, 11); case u: return f ? d(1, m) : d(0, m + 1); case s: var g = this.$locale().weekStart || 0, v = (l < g ? l + 7 : l) - g; return d(f ? y - v : y + (6 - v), m); case i: case "date": return $(M + "Hours", 0); case r: return $(M + "Minutes", 1); case e: return $(M + "Seconds", 2); case n: return $(M + "Milliseconds", 3); default: return this.clone() } }, d.endOf = function (t) { return this.startOf(t, !1) }, d.$set = function (s, o) { var h, f = D.p(s), c = "set" + (this.$u ? "UTC" : ""), d = (h = {}, h[i] = c + "Date", h.date = c + "Date", h[u] = c + "Month", h[a] = c + "FullYear", h[r] = c + "Hours", h[e] = c + "Minutes", h[n] = c + "Seconds", h[t] = c + "Milliseconds", h)[f], $ = f === i ? this.$D + (o - this.$W) : o; if (f === u || f === a) { var l = this.clone().set("date", 1); l.$d[d]($), l.init(), this.$d = l.set("date", Math.min(this.$D, l.daysInMonth())).toDate() } else d && this.$d[d]($); return this.init(), this }, d.set = function (t, n) { return this.clone().$set(t, n) }, d.get = function (t) { return this[D.p(t)]() }, d.add = function (t, o) { var h, f = this; t = Number(t); var c = D.p(o), d = function (n) { var e = g(f); return D.w(e.date(e.date() + Math.round(n * t)), f) }; if (c === u) return this.set(u, this.$M + t); if (c === a) return this.set(a, this.$y + t); if (c === i) return d(1); if (c === s) return d(7); var $ = (h = {}, h[e] = 6e4, h[r] = 36e5, h[n] = 1e3, h)[c] || 1, l = this.$d.getTime() + t * $; return D.w(l, this) }, d.subtract = function (t, n) { return this.add(-1 * t, n) }, d.format = function (t) { var n = this; if (!this.isValid()) return "Invalid Date"; var e = t || "YYYY-MM-DDTHH:mm:ssZ", r = D.z(this), i = this.$locale(), s = this.$H, u = this.$m, o = this.$M, a = i.weekdays, h = i.months, c = function (t, r, i, s) { return t && (t[r] || t(n, e)) || i[r].substr(0, s) }, d = function (t) { return D.s(s % 12 || 12, t, "0") }, $ = i.meridiem || function (t, n, e) { var r = t < 12 ? "AM" : "PM"; return e ? r.toLowerCase() : r }, l = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: o + 1, MM: D.s(o + 1, 2, "0"), MMM: c(i.monthsShort, o, h, 3), MMMM: h[o] || h(this, e), D: this.$D, DD: D.s(this.$D, 2, "0"), d: String(this.$W), dd: c(i.weekdaysMin, this.$W, a, 2), ddd: c(i.weekdaysShort, this.$W, a, 3), dddd: a[this.$W], H: String(s), HH: D.s(s, 2, "0"), h: d(1), hh: d(2), a: $(s, u, !0), A: $(s, u, !1), m: String(u), mm: D.s(u, 2, "0"), s: String(this.$s), ss: D.s(this.$s, 2, "0"), SSS: D.s(this.$ms, 3, "0"), Z: r }; return e.replace(f, function (t, n) { return n || l[t] || r.replace(":", "") }) }, d.utcOffset = function () { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15) }, d.diff = function (t, h, f) { var c, d = D.p(h), $ = g(t), l = 6e4 * ($.utcOffset() - this.utcOffset()), m = this - $, y = D.m(this, $); return y = (c = {}, c[a] = y / 12, c[u] = y, c[o] = y / 3, c[s] = (m - l) / 6048e5, c[i] = (m - l) / 864e5, c[r] = m / 36e5, c[e] = m / 6e4, c[n] = m / 1e3, c)[d] || m, f ? y : D.a(y) }, d.daysInMonth = function () { return this.endOf(u).$D }, d.$locale = function () { return m[this.$L] }, d.locale = function (t, n) { if (!t) return this.$L; var e = this.clone(), r = M(t, n, !0); return r && (e.$L = r), e }, d.clone = function () { return D.w(this.$d, this) }, d.toDate = function () { return new Date(this.valueOf()) }, d.toJSON = function () { return this.isValid() ? this.toISOString() : null }, d.toISOString = function () { return this.$d.toISOString() }, d.toString = function () { return this.$d.toUTCString() }, c }(); return g.prototype = v.prototype, g.extend = function (t, n) { return t(n, v, g), g }, g.locale = M, g.isDayjs = y, g.unix = function (t) { return g(1e3 * t) }, g.en = m[l], g.Ls = m, g });

會在Dayjs的原型上添加: formNow

!function (r, e) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (r = "undefined" != typeof globalThis ? globalThis : r || self).dayjs_plugin_relativeTime = e() }(this, (function () { "use strict"; return function (r, e, t) { r = r || {}; var n = e.prototype, o = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" }; function i(r, e, t, o) { return n.fromToBase(r, e, t, o) } t.en.relativeTime = o, n.fromToBase = function (e, n, i, d, u) { for (var f, a, s, l = i.$locale().relativeTime || o, h = r.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], m = h.length, c = 0; c < m; c += 1) { var y = h[c]; y.d && (f = d ? t(e).diff(i, y.d, !0) : i.diff(e, y.d, !0)); var p = (r.rounding || Math.round)(Math.abs(f)); if (s = f > 0, p <= y.r || !y.r) { p <= 1 && c > 0 && (y = h[c - 1]); var v = l[y.l]; u && (p = u("" + p)), a = "string" == typeof v ? v.replace("%d", p) : v(p, n, y.l, s); break } } if (n) return a; var M = s ? l.future : l.past; return "function" == typeof M ? M(a) : M.replace("%s", a) }, n.to = function (r, e) { return i(r, e, this, !0) }, n.from = function (r, e) { return i(r, e, this) }; var d = function (r) { return r.$u ? t.utc() : t() }; n.toNow = function (r) { return this.to(d(this), r) }, n.fromNow = function (r) { return this.from(d(this), r) } } }));

給dayjs的全局變量Ls添加一個中文支持

!function(e,_){"object"==typeof exports&&"undefined"!=typeof module?module.exports=_(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],_):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_zh_cn=_(e.dayjs)}(this,(function(e){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=_(e),d={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,_){return"W"===_?e+"周":e+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah點(diǎn)mm分",LLLL:"YYYY年M月D日ddddAh點(diǎn)mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內(nèi)",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"},meridiem:function(e,_){var t=100*e+_;return t<600?"凌晨":t<900?"早上":t<1100?"上午":t<1300?"中午":t<1800?"下午":"晚上"}};return t.default.locale(d,null,!0),d}));

插件使用

<script src="./libs/day.js"></script>
// 會在Dayjs的原型上添加: formNow
<script src="./libs/dayjs.relative-time.js"></script>

//給dayjs的全局變量Ls添加一個中文支持
<script src="./libs/dayjs.zh-cn.js"></script>
// 1.安裝插件
dayjs.extend(dayjs_plugin_relativeTime)
dayjs.locale('zh-cn')
//1. 1個小時 5分鐘 2天前
var day = dayjs(1656206934331)
console.log(day.fromNow())

3.通過Dayjs獲取和控制時間

<script src="./libs/day.js"></script>


//基礎(chǔ)寫法
// 1.拿到Dayjs的效果
var day = dayjs()

// 獲取時間
console.log(day.year(),(day.month()+1),day.date(),day.hour(),day.minute(),day.second())


//高階寫法
var day = dayjs()
          .year(2021)
          .month(5)
          .date(1)
console.log(day.year(),(day.month()+1),day.date(),day.hour(),day.minute(),day.second())

4.時間操作

<script src="./libs/day.js"></script>

//增加一天
var day = dayjs()
    .add(1, 'day')
    .startOf('year')
    .startOf('month');

console.log(day.format("YYYY-MM-DD HH:mm:ss"));

5.時間解析

<script src="./libs/day.js"></script>

// 1. 解析一個字符串類型的時間
// YYYY-MM-DD HH:mm:ss
// YYYY-MM-DD
// YYYY/MM/DD
var day1 = dayjs('2021-2-2 12:00:10');

// 2.解析時間戳(毫秒)
var day2 = dayjs(1656206934331);

// 3.解析時間戳(秒)
var day3 = dayjs.unix(1656206934);

// 4.解析data對象
var day4 = dayjs(new Date('2022-10-1'));

// 時間的格式化
console.log(day1.format("YYYY-MM-DD HH:mm:ss")); // 格式化輸出日期時間

6.手寫Day.js

JS封裝函數(shù)

;(function(g){
    //browser -> window ; 
    //node -> global

    //globalThis -> ES11
    g = typeof globalThis !== 'undefined' ? globalThis : g || self

    
    //構(gòu)造函數(shù)
    function Dayjs(){
        var date = new Date()
        this.$Y = date.getFullYear()
        this.$M = date.getMonth()
        this.$D = date.getDate()
    }
    Dayjs.prototype.format = function(){
        return `${this.$Y}-${(this.$M+1)}-${this.$D}`
    }
    // ....原型的方法
    // ....原型的方法
    // ....原型的方法
    // ....原型的方法
    // ....原型的方法
    // ....原型的方法
    // ....原型的方法


    //工廠函數(shù)
    function dayjs(){
        return new Dayjs()
    }
    dayjs.prototype = Dayjs.prototype
    //統(tǒng)一導(dǎo)出
    g.dayjs = dayjs
})(this)

HTML結(jié)構(gòu)

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="./utils/JYDayjs.js"></script>
    <script>
        console.log("%O", dayjs)
        console.log("%O", dayjs())// 創(chuàng)建dayjs對象
        console.log(dayjs().format()) //拿到當(dāng)前的時間
    </script>
</body>

</html>

三、Day.js的應(yīng)用

Day.js 是一個非常方便的日期和時間處理庫,可以在各種 Web 開發(fā)項(xiàng)目中使用。以下是一些 Day.js 的常見應(yīng)用場景:

  • 日期顯示和格式化: Day.js 可以幫助你將日期和時間格式化為特定的格式,以便在用戶界面中顯示。比如,你可以將日期格式化為 "YYYY-MM-DD"、"YYYY-MM-DD HH:mm:ss" 等等,以滿足項(xiàng)目的需求。

  • 日期計算和操作: Day.js 提供了豐富的日期計算和操作方法,如增加/減少天數(shù)、月份、年份,獲取某個日期的起始時間或結(jié)束時間等。這些功能對于實(shí)現(xiàn)各種日期邏輯非常有用,比如計算兩個日期之間的差值、判斷某個日期是否在指定范圍內(nèi)等。

  • 日期解析和轉(zhuǎn)換: Day.js 可以解析各種格式的日期字符串、時間戳和 Date 對象,并將它們轉(zhuǎn)換為 Day.js 對象,便于后續(xù)的操作和處理。這對于從用戶輸入或后端接口中獲取日期數(shù)據(jù)非常有用。

  • 相對時間和持續(xù)時間: Day.js 提供了一些方法來處理相對時間,比如獲取當(dāng)前時間相對于另一個時間的差值(如 "3 天前"、"1 小時前" 等),以及計算持續(xù)時間(如 "2 小時 30 分鐘")。

  • 本地化和時區(qū)處理: Day.js 支持本地化和時區(qū)處理,可以根據(jù)用戶的地理位置和偏好顯示本地化的日期和時間格式,并且可以在不同的時區(qū)之間進(jìn)行轉(zhuǎn)換和處理。

  • 事件日歷和計劃安排: Day.js 可以幫助你實(shí)現(xiàn)事件日歷和計劃安排功能,比如顯示日歷、添加/編輯事件、設(shè)置提醒等。你可以利用 Day.js 的日期計算和格式化功能來實(shí)現(xiàn)這些功能,并且可以根據(jù)用戶的需求進(jìn)行定制化開發(fā)。

  • 表單驗(yàn)證和日期選擇器: Day.js 可以用于表單驗(yàn)證和日期選擇器,幫助用戶輸入正確格式的日期,并且可以根據(jù)用戶的輸入實(shí)時驗(yàn)證日期的有效性。你可以結(jié)合其他前端框架或組件庫(如 React、Vue、Bootstrap 等)來實(shí)現(xiàn)這些功能。

四、最終手寫Day.js封裝

(function(g){
    g = typeof globalThis !== 'undefined' ? globalThis : g || self;

    // 構(gòu)造函數(shù)
    function Dayjs(dateString) {
        if (dateString) {
            var parsedDate = new Date(dateString);
            if (isNaN(parsedDate.getTime())) {
                throw new Error('Invalid date format');
            }
            this.$Y = parsedDate.getFullYear();
            this.$M = parsedDate.getMonth();
            this.$D = parsedDate.getDate();
        } else {
            var currentDate = new Date();
            this.$Y = currentDate.getFullYear();
            this.$M = currentDate.getMonth();
            this.$D = currentDate.getDate();
        }
    }

    // 格式化日期
    Dayjs.prototype.format = function(formatString = 'YYYY-MM-DD') {
        const year = this.$Y;
        const month = (this.$M + 1).toString().padStart(2, '0');
        const day = this.$D.toString().padStart(2, '0');

        return formatString.replace(/YYYY/g, year)
                            .replace(/MM/g, month)
                            .replace(/DD/g, day);
    }

    // 工廠函數(shù)
    function dayjs(dateString) {
        return new Dayjs(dateString);
    }

    // 原型鏈處理
    dayjs.prototype = Object.create(Dayjs.prototype);
    dayjs.prototype.constructor = dayjs;

    // 導(dǎo)出
    g.dayjs = dayjs;
})(this);

總結(jié) 

到此這篇關(guān)于js如何快速處理日期以及手寫Day.js的文章就介紹到這了,更多相關(guān)JS中Day.js使用內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論