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

fix: support date formats with translated strings #4000

Closed
ravinderk opened this issue Feb 15, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@ravinderk
Copy link
Collaborator

commented Feb 15, 2019

Bug Report

User Story

As a site admin for sites with a default format of j F Y (many European users), I want to be able to add and change the date on donations.

ref: impress-org/give-manual-donations#141

Current Behavior

When you try to update the date on the resulting donation it will only save as today's date.

Expected Behavior

I expect to be able to update the donation date with the correct historical date.

Bug Type

  • This bug describes functionality that once worked as expected in version X.X.X.
  • This bug describes functionality that never worked as expected.
  • I am not sure whether this functionality ever worked as expected.

Steps to Reproduce

  1. Set language to (fr_FR)
  2. Change the date format at Settings > General to j F Y
  3. Attempt to create a donation (any date will replicate the problem)
  4. On the resulting donation, attempt to change the date
  5. It won't work.

Acceptance Criteria

  • Donations updated that date format work as expected
  • The fix does not affect donations added in other date formats

@ravinderk ravinderk self-assigned this Feb 15, 2019

@kevinwhoffman kevinwhoffman changed the title fix: support the j F Y date format #141 fix: support date formats with translated strings Feb 15, 2019

@kevinwhoffman

This comment has been minimized.

Copy link
Member

commented Feb 15, 2019

@ravinderk I think the cause of the issue needs clarified. As I discovered in the related WPBR issue, the problem is not so much the j F Y format but rather the presence of a translated string in the date.

I am copying my explanation here for reference:

The j. F Y format worked fine as a custom format with English (United States) site language. However I was able to replicate the error once I changed the site language to Deutsch.

The cause of the error is not any specific format, but rather any format that includes translated words as opposed to numbers. For example, I replicated the error on a Deutch site using both j. F Y and F j, Y formats, whereas m/d/Y worked fine because it did not include a translated word like Oktober.

Also updating the issue title for clarity.

@ravinderk

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 17, 2019

@kevinwhoffman I found that we are using datepicker in the following places:

  1. Donor listing page
  2. Donation listing page
  3. Form listing page
  4. Donation detail page
  5. Export page
  6. Export donation history page
  7. Addon:
    1. Gift Aid: There is very less chance that gift aid Datepicker will break because currently, it is working fine with existing UK installs.
    2. Recurring

@kevinwhoffman Fix can affect third party code if they are expecting a date in WordPress format.

I am planning to update JS code to automatically convert give_datepicker input field to text and hidden element. let me know what do you think. By this way, the issue may be fixed automatically on a few places.

DevinWalker added a commit that referenced this issue Feb 20, 2019

Merge pull request #4005 from impress-org/issue/4000
fix: support date formats with translated strings #4000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.