Comments (2)
This library doesn’t implement a calendaring system per se; it relies on JavaScript’s built-in Date class, which implements the Gregorian calendar. In theory, it would be possible to extend this library to support other calendaring systems, but I don’t have a sense of how practical that would be. I see two challenges:
-
This library calls
new Date
internally (see interval.js), so if you want to substitute a different Date class (such as hijri-date), you’ll need to modify the code to allow the Date constructor to be overridable. The Date substitute will also need to implement date.setTime. -
The built-in intervals may or may not be applicable in the non-Gregorian calendar system. Depending on which of these built-in intervals you want to reuse, the Date substitute will need to implement other methods. For example, the day interval requires date.setHours, date.setDate, date.getDate and date.getTimezoneOffset.
I do not personally plan on implementing the Hijri calendar in JavaScript, so I am going to close this issue. But, if you wish to submit a pull request to address the first issue and allow the Date constructor to be overridable, I would be happy to review it, especially if you are willing to include a demonstration showing how to use it with other calendar systems. Thank you!
from d3-time.
Hello @mbostock ,
I did some investigation in Hijri Date , I found some missing implementation need to be added as setTime, setHours, .. we request that from owner to be able to use it here.
Can you advise the best way to use external library like Hijri Date, with D3-Time. Especially if this library contain "require" function between files. If there an example you can share this will be great.
from d3-time.
Related Issues (20)
- Filtered intervals' offset() function doesn't work correctly when step is negative HOT 1
- interval.range should protect against infinite loops. HOT 9
- bug where the same dates are not recognised as the same as each other (==), but are also not recognised as either less then or more then the other! HOT 2
- Visualizing date based on Hijri date series HOT 2
- timeMinute, timeHour are sometimes wrong (Chrome 67). HOT 10
- Tick format for dates before 1900-01-01 rendered as ":00" HOT 1
- interval.range function fails for Day interval when crossing daylight savings time in Brazilian time zone. HOT 1
- d3.timeMonth.offset() returns not the best thing for final days of the month HOT 1
- Hope to add timeQuarter HOT 3
- rangeInclusive HOT 4
- range in descending order? HOT 2
- Week starts on Monday HOT 1
- Half years for time axis HOT 2
- interval.every and interval.range generate different result with the same step
- interval.range() with option to include the stop interval boundary HOT 2
- infinite loop on _interval_.filter HOT 2
- Request: export `ticker` HOT 1
- Equivalent of d3.unixDay for local time HOT 1
- interval.every can return intervals of inconsistent length HOT 1
- Incomplete TS type def for `timeTicks`? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-time.