recentlyjs

0.0.5 • Public • Published

recentlyjs

依赖dayjs的一个列举距当前日期最近具体是哪些天、哪些月的js插件(持续更新中...)

下载

npm i recentlyjs -S

引入

import { lastDates, lastMonth } from 'recentlyjs';

使用

const daysArr = lastDates(30[, options]) // 最近30天
const monthArr = lastMonth(6[, options]) // 最近6个月

参数options

options = {
	// 分隔符, 日期数字之间的连接符
	divider: {
		type: String,
		required: fales,
		default: '-'
	},
	// 结束时间点
	datePoint: { 
		type: String | Date | timeStamp,
		required: fales,
		default: new Date() // 当前时间
	}
}

DEMO展示

demo.gif

CHANGELOG

v0.0.4: 去掉lodash,修改lastDates当开始时间跟结束时间是同一个月份时的BUG,现在最近天数可以是任意

v0.0.5: 修改lastMonth的BUG

github

https://github.com/yanyi24/recently.git

Package Sidebar

Install

npm i recentlyjs

Weekly Downloads

2

Version

0.0.5

License

ISC

Unpacked Size

6.05 kB

Total Files

3

Last publish

Collaborators

  • yanyi24