-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use SERIAL_NUMBER for Date parsing #165
Conversation
d21bbe1
to
d4b1b60
Compare
What does this mean? What's the implication of this |
Before when syncing a spreadsheet, we would automatically detect the date cells as Date. Now they would be detected as Number (being the Doing two calls to the APIs should be fine, given that until now we only check the row under the header when inferring the type. We could probably reduce the range to only get the second row? Wdyt? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean by another API call. I've not touched this plugin before so I don't know what past changes have been made, if you're referring to something it previously did. 🙏 |
Signed-off-by: Cédric Boirard <[email protected]>
d4b1b60
to
60317d4
Compare
@tom-james-watson let me clarify what I meant about the API calls. Previously, when someone imported a Google Sheet, we would automatically detect which columns were dates by looking at how they appeared in the sheet (using In this PR, I switched to using If we want to bring back auto-detection while keeping the reliable date parsing, we could make two API calls:
|
Nice, I think that would be better yeah, because it's not ideal to have to go and switch all date columns to "Date" type manually. Would that be as part of this PR? |
Does this work correctly with timezones? We store our dates in Zulu timezone, and we strip off the time, unless the field supports both date + time. |
Didn't we consider using a different API, with richer meta data? I think it was punted on because of being out-of-scope in another PR, but it feels like we keep running into these "loosey goosey schema" issues 😛 |
@tom-james-watson yes, I think we should keep the feature!
Actually yes, we can use the |
I don't think it will be "try"! Just |
Yes it does! The actual output from Google Sheets is a float, |
Let's release this as is to first unblock our users. And add re-add the Date type inferring when handling https://github.com/framer/company/issues/31805. |
Closes https://github.com/framer/company/issues/31732
Description
This pull request use the
SERIAL_NUMBER
date time render option from Google Sheets to get the correct Date value. Before we were relying on the cell formatted value which could be set to a non-standardized (ISO 8601).Doing so, we lose the ability to auto-detect dates field (we could add it back by doing another call to the API as we were doing before e.g. using
FORMATTED_STRING
)Testing
With Date
sheet from → https://docs.google.com/spreadsheets/d/1o1RaseNzmT1ug5kYQr-LWrHbCWCglOISJpv8jGdxC28/edit?usp=sharing.Published Date
column type to Date