Comments (5)
Yes, I'm afraid that you're right. You cannot decide, what time zone data will be used on the date-fns-timezone
level.
Actually, I didn't expect, that the 2012-2022 data would be wanted so much :-) I didn't consider it important, because dates are entered in form fields im my application and it is impossible to predict how old date will be entered there. Hence always all time zones...
timezone-support
is a bunch of functions and no object instance to initialize and send around. I will need to think something up, either some context object with the time zone data, or a global initialization.
from date-fns-timezone.
Very nice library, thanks! But yes, we have a similar problem: we need to use a custom timezone data bundle generated by timezone-support
. Any suggestions on how to add this? I'd be happy to put in a PR.
from date-fns-timezone.
Any updates?
from date-fns-timezone.
If using webpack you can alias timezone-support to one of the limited data versions.
resolve: {
alias: {
'timezone-support$': path.resolve(
__dirname,
'node_modules/timezone-support/dist/index-1970-2038.js'
)
}
}
from date-fns-timezone.
with gatsby in gatsby-node.js
:
const path = require('path');
exports.onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
resolve: {
alias: {
'timezone-support$': path.resolve(
__dirname,
'node_modules/timezone-support/dist/index-2012-2022.js'
),
},
},
});
};
from date-fns-timezone.
Related Issues (16)
- Typings HOT 1
- Formatting options typing is incomplete. HOT 3
- Z character not escaped when put in square brackets HOT 2
- US/Central Time 1 Hour Off HOT 1
- version 0.1.4 doesn't have updated Brazil timezone information HOT 1
- How to set a new Date() value with dynamic timezone
- IE error occured HOT 4
- formatToTimeZone depends unexpectedly on system timezone
- Timezone formatted incorrectly for timezones that are not rounded to a minute offset of UTC HOT 1
- Using date-fns version 1.29
- Switch from DST to non-DST impacts the results HOT 1
- Asia/Kolkata vs Asia/Calcutta
- Plans for date-fns v2? HOT 10
- Does this library considers day light saving for time zones? HOT 1
- Convert to timezone returning a diffrent value from moment-timzone. HOT 2
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 date-fns-timezone.