Coder Social home page Coder Social logo

dayjs-plugin-calendar-sets's Introduction

dayjs-plugin-calendar-sets's People

Contributors

jiangweixian avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

dayjs-plugin-calendar-sets's Issues

Generated dataset is wrong when it's February?

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.