Skip to content
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

Setting a Baptism Date results in a saved date of 1 day less than the specified date #408

Closed
zdmc23 opened this issue Aug 21, 2020 · 9 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@zdmc23
Copy link
Collaborator

zdmc23 commented Aug 21, 2020

Observed on iOS 13.6

Setting a Baptism Date results in a saved date of 1 day less than the specified date

Steps to reproduce:

  1. Login to "dtappdemo" instance
  2. Select Hans 1234 Contact
  3. Click Progress
  4. Click Edit
  5. Select a new Baptism Date
  6. Observe change has taken effect properly
  7. Click Save
  8. Observe upon refresh/reload that the date is now displaying as 1 day less than the specified date

For reference, please see video:
https://youtu.be/XlkWbZjlbrI

@zdmc23 zdmc23 added the invalid This doesn't seem right label Aug 21, 2020
@zdmc23 zdmc23 added this to the Sprint 26 milestone Aug 21, 2020
@zdmc23 zdmc23 added bug Something isn't working and removed invalid This doesn't seem right labels Aug 31, 2020
@yorkaspacher
Copy link
Contributor

Guess what! This is happening in the web version. Just opened a contact in my DEMO site, tapped Baptized in Faith Journey, selected - very distinctly - September 7, 2020, and it saved it as September 6, 2020. Don't think this is a mobile app bug.

@zdmc23
Copy link
Collaborator Author

zdmc23 commented Sep 11, 2020

Nice catch @yorkaspacher ! I always like the bugs that are on @corsacca 's side :-P

@corsacca
Copy link
Member

@zdmc23 does https://dtappdemo.wpengine.com/contacts/1775/ display march 11 or march 12 for you now?
It shows march 12 for me both on the web version and on the app.
Since the timestamp represents the start of the day in utc in wonder if there is some timezone conversion going on.

@zdmc23
Copy link
Collaborator Author

zdmc23 commented Sep 14, 2020

@corsacca March 11 is displayed for me

Screenshot from 2020-09-14 09-35-25

@zdmc23
Copy link
Collaborator Author

zdmc23 commented Sep 14, 2020

@corsacca You're probably correct that it's a date conversion issue

@raschdiaz We're going to need convert to/from UTC and Local time in Moment.js, as described here: https://stackoverflow.com/questions/32540667/moment-js-utc-to-local-time#32540840 . We can probably start by modifying the formatDateToBackEnd method that you have in shared/index.js

@corsacca
Copy link
Member

@zdmc23 Ok Thanks for confirming. It is an issue on both the web and mobile. I changed the time zone on my computer and the date changed for me too.
Note: The "formatted' parameter of the date field is likely correct. The timestamp is the start of the day utc, so with timezones it will be converted to the previous day in the USA.

@zdmc23
Copy link
Collaborator Author

zdmc23 commented Sep 15, 2020

I've resolved this in b25a141 , but it's not clear to me why the Comments and Activity dates do not also require this change (tho it's working, so I won't think too hard about it ;-) )

@zdmc23 zdmc23 self-assigned this Sep 15, 2020
@corsacca
Copy link
Member

@zdmc23 for comments we want to convert to the current time zone so the user knowns when the comment was created in their own time zone.
For dates we don't want to convert.

@zdmc23
Copy link
Collaborator Author

zdmc23 commented Sep 16, 2020

@corsacca thanks for clarifying. No worries, I didn't change the way that the dates are saved, only viewed in the app

It might simplify things if we stored every date as UTC and displayed it in the clients (website and mobile app) in the user's time zone.

Supposedly newer versions of JavaScript will support i18n of dates in the core of the language via Date and Intl objects:

zdmc23 added a commit that referenced this issue Sep 20, 2020
* Bump to 1.7

* resolves #411

notifications screen: changed the separator from being | to ~

* Resolves #329

* Resolves #335 - Initial version of support for Questionnaire Plugin

* Resolves #304

* Resolves #304

* Resolves #417

* Resolves #407 - Reintroduce Hans PR #438

* Resolves #424 - Reintroduces Hans PR #438

* Temporarily remove Sentry (see #438)

* Significant UI fixes (#442)

Resolves #259

* Manually fix security vulnerabilities in dependencies

* Resolves #408 - specify utc() when displaying date (view mode) per DatePicker fields

* Sprint 26 (#446)

* Adding missing icons to fields

Adding missing icons to fields on contact details, edit and new screens.

* FAB action colors

giving the fab actions a different color to help quickly identify each action.

* Add initial comment icon

* reformatting Icon code for consitency

* fix icon from user to users for group edit screen

on the group edit screen it used incorrectly a singular icon for group name instead of the group icon.

And minor code cleanup.

* Add new group icons

Group name and Group type

* import status icon; remformatted code identations

* Adding status icons to contacts and group screens

* resolves #259 and adds colors to icons

* styling for addIcons & removeIcons

* added icon for milestone

Added around lines 3014 and 3100 the icon "Octicons" incon named "milestone".

* added fieldsIcons style

fieldsIcons: {
    height: 20,
    width: 20,
  },

* minor sizing adjustments to the icons

* Resolve #407

* Resolves #424

* refinements to remove code conflicts

* fix for church_start_date bad alignment

* Resolve #405

Co-authored-by: Mike Allbutt <yo@ur.id.au>
Co-authored-by: Zachary McCoy <191707+zdmc23@users.noreply.github.com>

* Resolves #403 - Group FAB button \(temporarily Comments only until D.T is ready with Activities)

* Resolves #447 - case-insensitive comment authorship check

* Icons and UIX adjustments (#449)

* group date icons using fonts

replaced the icons to use fonts

* Swapping icons & adjusting spacings

assigned_to and subassigned now use the same icons as the website; contact relation icon better represents what the field relats to;

* FAB icon bottom padding

Increased so that the FAB does not block the last items on the screen.

* Include support for Serbian, Slovenian, and Croatian languages; updates to existing languages files

* Include new languages in Moment to handle TZ; update language labels

* Ui comments - edit and delete for contacts and groups (#451)

* Reduced icon sizes & aligned vertically

* Modifying the Delete & Edit buttons

* Re-inserted the "editComment" and "deleteComment" lines

* "delete" added to the language files

added "delete" and used the existing text from the "deleteComment" translation - becuase it should be the same.

* Fix some RTL layouts on Contact Details

* RTL - fixes for text that was incorrectly aligning to the left and not right (#453)

* aligned text to right if RTL

URL and username field now align right when RTL is set.

This also address an issue with #372 by reducing the height of the DT logo.

* aligned text in connections fields

* added this.props.isRTL to various fields

* aligning fields in group record

* aligning the lists

The text of list items now correctly align to the left or right, depending on the language direction.

* Fix text layout issue for iOS, and accomodate for "notch" per logo

* minor design adjustments (#454)

* Resolves #455 - Do not show FAB button in Edit Mode

Co-authored-by: Mike Allbutt <yo@ur.id.au>
Co-authored-by: Hans Rasch <raschdiaz@gmail.com>
Co-authored-by: MexSurfer <43966676+mikeallbutt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants