Jiangweixian, a front-end engineer
jiangweixian / dayjs-plugin-calendar-sets Goto Github PK
View Code? Open in Web Editor NEWdayjs plugin generate calendar set data
License: MIT License
dayjs plugin generate calendar set data
License: MIT License
Jiangweixian, a front-end engineer
Hi, I'm using your plugin for my project, thanks for that.
I ran into this issue and this is weird, because I didn't get this issue at last month.
My code looks below:
import dayjs from 'dayjs';
import CalendarSets from 'dayjs-plugin-calendar-sets';
dayjs.extend(CalendarSets);
const date = dayjs();
const sets = dayjs.calendarSets({ year: date.year() }).month({ month: 0 });
console.log(sets);
I expect the output to be:
[
['', '', '', '', '', '', '2023-01-01'],
['2023-01-02', '2023-01-03', '2023-01-04', '2023-01-05', '2023-01-06', '2023-01-07', '2023-01-08'],
['2023-01-09', '2023-01-10', '2023-01-11', '2023-01-12', '2023-01-13', '2023-01-14', '2023-01-15'],
['2023-01-16', '2023-01-17', '2023-01-18', '2023-01-19', '2023-01-20', '2023-01-21', '2023-01-22'],
['2023-01-23', '2023-01-24', '2023-01-25', '2023-01-26', '2023-01-27', '2023-01-28', '2023-01-29'],
['2023-01-30', '2023-01-31', '', '', '', '', '']
]
But the actual output is:
[
['', '', '', '', '', '', '2023-01-01'],
['2023-01-02', '2023-01-03', '2023-01-04', '2023-01-05', '2023-01-06', '2023-01-07', '2023-01-08'],
['2023-01-09', '2023-01-10', '2023-01-11', '2023-01-12', '2023-01-13', '2023-01-14', '2023-01-15'],
['2023-01-16', '2023-01-17', '2023-01-18', '2023-01-19', '2023-01-20', '2023-01-21', '2023-01-22'],
['2023-01-23', '2023-01-24', '2023-01-25', '2023-01-26', '2023-01-27', '2023-01-28', '2023-01-01'],
['2023-01-02', '2023-01-03', '', '', '', '', '']
]
This happens no matter what month I use for .month()
's parameter. The strange thing is, that this didn't happened until last week, and the only thing I suspect is that the month changed; It's February and in Feb there are only 28 days this year.
Could you check this issue?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.