-
Notifications
You must be signed in to change notification settings - Fork 0
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
Problem with dates when surveys are entered through, or changed in, BioCollect #179
Comments
Quite strange. I was able to reproduce it, definitely a bug. Before digging int details, I have contacted the australian team, to make sure this is not a bug they have as well. |
OK, strange! Strange also if they have it and didn’t notice it.
If it is not solved until I make the new PostgreSQL tables, I’ll try to remember to change it “manually” in Excel.
Hm, that will be almost impossible, because it is not ALL dates that are wrong, only those reported in BioCollect.
We’ll have to live with it for while, it won’t affect anything in the year report work at least.
Fortsätt med ditt fina arbete Mathieu, det känns väldigt tryggt att ha din support nu. Förhoppningsvis skall du snart få tid att göra annat än SFT-support!
Åke
Från: mathieuLU ***@***.***>
Skickat: Thursday, 13 January 2022 16:47
Till: biodiversitydata-se/biocollect ***@***.***>
Kopia: Åke Lindström ***@***.***>; Author ***@***.***>
Ämne: Re: [biodiversitydata-se/biocollect] Problem with dates when surveys are entered through, or changed in, BioCollect (Issue #179)
Quite strange. I was able to reproduce it, definitely a bug.
Before digging int details, I have contacted the australian team, to make sure this is not a bug they have as well.
We never changed anything in that part of the code, so it's a very surprising bug.
—
Reply to this email directly, view it on GitHub<#179 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AXBWL5UBYJWRK7EVBMBYPB3UV3XWDANCNFSM5K6DOOJA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Wild guess. Could it be that there is something with Australian time vs. Swedish time? I know they are 7-10 h ahead of us down there.... |
ok so we have 2 problems in one. 1- When a survey is edited, the output date (surveyDate field) is changed, but the change is not applied to the records (eventDate field). 2- A date edited can be displayed "the day before". Because of the way it's stored in the database.
so due to the timezones, the date is set to the day before, kl23:00 ! And then when the date is extracted, we get only the first part, regardless of the time... to fix it, the best would be to keep the surveyStartTime attached to the date. To make sure we keep this information. |
[I did this while you were active - but I publish it nevertheless] https://biocollect.biodiversitydata.se/sft/bioActivity/index/b6bd73a1-d868-4b6c-93d9-8acda09b3801 They were both "under review". Just for testing, I therefore made them "approved", but that didn't change anything. They were still OK (as they should be). Both on my "personal page" (undersökningar) and in a new Intranet extraction of all vinterpunktruttdata. |
I'm quite sure I understand why it works with these 2, and not for other previous examples. => so the date is saved with the default setting, which was the datetime => it works fine. In the database :
For all the other cases with bugs, it happens the moment the user is changing the date. |
The temporary fix is in place. SO when you extract the files, the dates are fixed. I display a message, but I can hide it if it's too disturbing [2022-01-14 12:30:11] WARN : Date tranformed from 2021-05-23T22:00:00Z to 20210524 Remains to be done :
|
ok i fixed that page as well, to display the date accordingly o the timezone => (you can check your example below. The date is still "2020-12-20T23:00:00Z" in the database, but now the page is taking in consideration the timezone to display correctly that date) if you think about other places where survey dates are displayed, please let me know ! Remains to be done :
|
update 1- set to 12:00:00 when the date is changed through the JS snipet in BioCollect 2- fix the existing data in the database that have been set to day-1 (and set them to 12:0:00 ?) 3- fix the update function in BC to make sure the records are changed accordingly 4- fix that page as well |
Sometimes you're happy to be wrong :D 3- fix the update function in BC to make sure the records are changed accordingly => NO PROBLEM AT ALL. The record date (eventDate field) is perfectly edited, according to the output date (surveyDate field) Even the recorder name is changed accordingly. i change the priority now. |
Small things that remain : 1- set to 12:00:00 when the date is changed through the JS snipet in BioCollect 2- fix the existing data in the database that have been set to day-1 (and set them to 12:00:00 ?) |
For example:
In one recent survey, imported from the Intranet function, I needed to change the date. The date was changed to the correct 21 December 2020 (the previous and erroneous was 20 January 2021).
https://biocollect.biodiversitydata.se/sft/bioActivity/index/61a37560-facf-9be2-6005-95c5b36c0e4c
But when looking in the list of surveys carried out by this person, the date of that particular survey is one day wrong, 20 December.
https://biocollect.biodiversitydata.se/sft/person/edit/339a06bc-fb62-c034-1e71-4bedb7588e0d/?returnTo=/sft/project/index/89383d0f-9735-4fe7-8eb4-8b2e9e9b7b5c#activityList
See the very last survey of the list, which says 20 December 2020.
This error does not seem to occur in the files imported once from PostgreSQL, but only for protocols entered in BioCollect, or being edited in BioCollect.
Most importantly, it should be noted that also in the data exported to Excel using Intranet, the date becomes wrong!
The text was updated successfully, but these errors were encountered: