Skip to content

引入 ​

js
import { getDaysOfYearMonth } from "grantlibs";
或;
const { getDaysOfYearMonth } = require("grantlibs");
获取某年某月天数

使用 ​

ts

getDaysOfYearMonth(year?:number, month?:number): number

参数 ​

  1. year: 某年
  2. month: 某月

返回 ​

number: 天数。

示例 ​

js
const days = getDaysOfYearMonth();
// => 31