igor-ribeiro / calendar-js Goto Github PK
View Code? Open in Web Editor NEWPure calendar generator
License: MIT License
Pure calendar generator
License: MIT License
Hi, awesome lib!
I was wondering is there a way to disable certain days of the week for every week. I'm thinking whether it's a holiday or the business doesn't operate let's say on Tuesday and Thursday, how can I go about disabling those days in this lib?
Thank you in advance
generateCalendar: function(
year,
month,
numberOfDays,
firstWeekday,
lastWeekday,
dayTransformer,
cbData
)
This may be entirely based on the dataset we're working with, but in my case, one-indexed months seem much more intuitive (as this is what I immediately pass to other spec-compliant services).
ISO-8601 also lists months as one-indexed, (01 - January, 02 - February, ... , 12 - December). Would it be possible to switch to using this system from the zero-indexed format calendarJS is currently using?
Edit: Stupid me, I just realized JavaScript is using zero-indexed months. Guess I'll have to handle this manually then :(
Would be great if there was some other way to deal with this more elegantly.
Love the idea of this project.
I see that this GitHub page says it's currently failing.
But is this still maintained?
If not, do you have suggestions for other projects with the same philosophy?
This is the error that shows up if you do npm run build
:
ERROR in static/js/vendor.a6271913414e87e123c2.js from UglifyJs
Unexpected token: name (_months) [./node_modules/calendar-js/index.js:56,0][static/js/vendor.a6271913414e87e123c2.js:90602,6]
Vue + Webpack doesn't like the let
's in the index.js of this project (the const's are okay).
I believe the current version of UglifyJS that Webpack has doesn't play well with ES6.
I wonder if you could replace the let
's in index.js with var
's? That would save my project for this month!
(Some say that this issue with UglifyJS will be solved in Webpack 4.)
Remove the require
statements and throw normal errors so it can be used on browsers without browserify. #15
Hi, thanks for the work done. Can you add an option for specifying the first day of the week? In many countries, the week begins on Monday and not on a Sunday.
This is the whole log with relevant information:
09 02 2018 14:12:11.407:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
09 02 2018 14:12:11.409:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
09 02 2018 14:12:11.412:INFO [launcher]: Starting browser PhantomJS
09 02 2018 14:12:13.030:INFO [PhantomJS 2.1.1 (Windows 7.0.0)]: Connected on socket S6T46Jv0x9nFm2flAAAA with id 33088078
ERROR LOG: '[Vue warn]: Error in mounted hook: "TypeError: undefined is not a constructor (evaluating 'new Array(length).fill(1)')"
(found in <Root>)'
ERROR LOG: TypeError{line: 11949, sourceURL: 'http://localhost:9876/base/index.js?de3a07e13bdce4abf00010ccfe90a34195d2eaeb', stack: 'createArray@http://localhost:9876/base/index.js?de3a07e13bdce4abf00010ccfe90a34195d2eaeb:11949:32
generateCalendar@http://localhost:9876/base/index.js?de3a07e13bdce4abf00010ccfe90a34195d2eaeb:12066:18
The version published to NPM is old and missing the .of method.
Hi! First of all thank you for this really easy to use calendar generator. Much much much more flexible rather than having to use other libraries that generate markup for me.
It would, however, be great if there was a function to validate whether a given date is valid (say, if I input Feb 29, 2017, it should return false).
Would this feature be in your roadmap? Thanks!
Hey man, just wanted to say kudos for building this thing. I had somewhat similar requirements as you and would've tried to build exactly the same thing if you hadn't already done so. Saved me a lot of time. Thanks again. ๐
Hello
How can I associate a day with calendar date?
Example:
1 = Sat 2 = Su 3 = Mo 4 = Yu
So when a user click on 1
will know it was a Sat
Thank you
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.