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

Wrong date when importing donations #6595

Open
Genevieve-K opened this issue Oct 27, 2022 · 2 comments
Open

Wrong date when importing donations #6595

Genevieve-K opened this issue Oct 27, 2022 · 2 comments
Labels
keep-fresh "Keep Fresh" issues should not be marked as stale. type: bug Existing functionality is broken

Comments

@Genevieve-K
Copy link
Contributor

User Story

As a admin, I want to export donations and import them in a new site.

Details

The date of donation is sometimes wrong.

Steps to Reproduce

  1. In WP settings > General, choose the format d/m/Y ( 27/10/2022 )
  2. Export the donations
  3. In another site, import the donations
  4. Some donations have the today date, other are not visible because they are in the futur.
  5. The donations in the future gives an 400 error in some new functions: Value 'future' is not part of the enum Give\Donations\ValueObjects\DonationStatus.
  6. We cannot delete the donations in the future.

Raison

In import-functions.php, the date is defined by: $post_date = mysql2date( 'Y-m-d', $data['post_date'] );
However, the mysql2date() suppse that the imput format is m/d/Y if the separator is a slash.
So '10/11/2022' becomes '11/10/2022' in the future.
And '27/10/2022' is an unexisting date.
I suggest to use the format selected in WP settings, with get_option('date_format').

I worked around by changing the settings before export the donations.

@Genevieve-K Genevieve-K added the type: bug Existing functionality is broken label Oct 27, 2022
@canny
Copy link

canny bot commented Nov 4, 2022

This issue has been linked to a Canny post: Wrong date when importing donations 🎉

@github-actions
Copy link

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 14 additional days. Note, if this Issue is reporting a bug, please reach out to our support at https://givewp.com/support. If this is a feature request, please see our feedback board at feedback.givewp.com — that’s the best place to make feature requests, unless you’re providing a PR.

@github-actions github-actions bot added the Stale label Jan 13, 2023
@kjohnson kjohnson added keep-fresh "Keep Fresh" issues should not be marked as stale. and removed Stale labels Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep-fresh "Keep Fresh" issues should not be marked as stale. type: bug Existing functionality is broken
Projects
None yet
Development

No branches or pull requests

2 participants