Comments (11)
@serkandurusoy I think you were the last person to touch the pickadate input type. Any thoughts on this?
from meteor-autoform-materialize.
Hm I used that ages ago - in software years :) - and I had a single timezone use case.
But I would expect the persisted date to be whatever the server timezone is (preferably Etc/UTC) and the displayed date to be whatever it corresponds to for the chosen time zone.
from meteor-autoform-materialize.
This is where this package diverges from autoform. In the original implementation the UTC time is used by default, https://github.com/aldeed/meteor-autoform#typedate .
In this package it's always saving with the browser timezone. Is this on purpose?
from meteor-autoform-materialize.
According to the source
and
it looks like it works as I described.
Edit:
As compared to your expactation from https://github.com/aldeed/meteor-autoform/blob/devel/inputTypes/datetime/datetime.js which does the conversion both ways
from meteor-autoform-materialize.
Yes I see now that it is just converting the date for display. However Autoform has date types that use UTC by default. That's a bit confusing. If others would find it useful I would propose that this should at least save it by UTC by default (since servertime is harder to control).
And/or optionally it could the timezone always for saving and displaying. Thoughts?
from meteor-autoform-materialize.
It would be a breaking change for existing apps at this point, so I'd suggest you to base a new component on this one.
In the meantime, http://yellerapp.com/posts/2015-01-12-the-worst-server-setup-you-can-make.html
Servers absolutely definitely surely inevitably undeniably must be set to Etc/UTC!
If that's not possible, then the app's enviornment
should be set as such. All PaaS providers (modulus, heroku, galaxy etc) allow for that, and barebone servers (aws, digital ocean etc) definitely do.
In fact, that' the first thing I do when I set up a server.
Even in my development environment, I provide the necesssary environment variables (which is TZ
) to the app server and database server instances regardless of my computer's user timezone.
from meteor-autoform-materialize.
So do you know if galaxy is by default on UTC. If it is UTC, then the component is actually using the browser timezone.
from meteor-autoform-materialize.
from meteor-autoform-materialize.
I confirmed that the component is using the browser timezone, rather than server. It returns a pickadate.obj, which is a client Date() object. Is this a feature or a bug that should be changed? It may be breaking for some people but I suspect few people are using local timezones intentionally.
valueOut: function() {
var picker = this.pickadate('picker');
var item = picker && picker.get('select');
return item && item.obj;
},
from meteor-autoform-materialize.
Well, this component has been out and in use for a year now and I am sure there are a lot of people who either consciously or unconsciously rely on how it handles dates. So changing it would probably come at a big surprize and even be damaging for some people.
I believe the way to fix this is not to change this component but either one of:
- add a new property such as
convertToCustomTimezone
that opts in to a different behavior - create a new component that is simply based on this one but does what you want (it should be very easy to do this and in fact you can do it now as a local package in your app)
from meteor-autoform-materialize.
Future work on this package has been transferred here. Thanks @mozfet
from meteor-autoform-materialize.
Related Issues (20)
- Still alive? HOT 2
- materialize icons don't work HOT 1
- add data-required on afFormGroup div HOT 1
- Multiple date picking ? HOT 1
- Multiple selects not rendering properly HOT 9
- pickadate is not a function Error HOT 5
- Could upgrade to last of AutoForm? HOT 8
- Prefilled form with number 0, breaks the CSS
- Placeholders overlapping input fields HOT 3
- input-col-class not supported HOT 1
- Reactively switch between select and free-text HOT 1
- select-checkbox-inline is not inline HOT 1
- select-radio-inline not showing HOT 4
- pickadate fields with type: Number are not formatting MM/YYYY in autoform 'Update' forms HOT 17
- pickadate within an array type, opens a modal within the array div. See image HOT 2
- How to make Array type horizontal or inline? HOT 1
- layout problem when displaying group of checkboxes HOT 1
- misaligned text on [ ADD + ] button for adding array elements HOT 1
- Internationalize ADD and REMOVE buttons 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 meteor-autoform-materialize.