lifterlms icon indicating copy to clipboard operation
lifterlms copied to clipboard

Correctly parse the date saved in Course Options > Restrictions > Enrollment Start Date based on WordPress Dashboard > Settings > General > Date Format.

Open dominiquemariano opened this issue 2 years ago • 2 comments

Reproduction Steps

  1. Refer to reproduction steps in https://github.com/gocodebox/lifterlms/issues/2447.
  2. Use the date picker to select a date for Course Options > Restrictions > Enrollment Start Date. Select January 6, 2023. It will enter 01/06/2023 as the date.
  3. Update the course.
  4. When you view the course on the front-end, it will not show an error such as Enrollment in this course opens on 01/06/2023 since today is March 29, 2023 and January 6, 2023 has already passed.
  5. Go back to the back-end of the course.
  6. On Course Options > Restrictions > Enrollment Start Date, change 01/06/2023 to 06/01/2023 (that, switch the month and day values).
  7. When you view the course on the front-end, it will show an error such as Enrollment in this course opens on 06/01/2023. It thinks of 06/01/2023 as if it were June 1,2023 when it should be treated as January 6, 2023 since you specified the d\m\Y date format in WordPress Dashboard > Settings > General > Date Format.

Expected Behavior

It does not correctly parse the date saved in Course Options > Restrictions > Enrollment Start Date based on the date format you specified in WordPress Dashboard > Settings > General > Date Format. In particular, it displays Enrollment in this course opens on ... on the front-end when you try to enter a date in the d/m/Y that could be mistakenly parsed as a future date.

Actual Behavior

It should correctly parse the date saved in Course Options > Restrictions > Enrollment Start Date based on the date format you specified in WordPress Dashboard > Settings > General > Date Format.

This issue has be recreated:

  • [x] Locally
  • [ ] On a staging site
  • [x] On a production website
  • [ ] With only LifterLMS and a default theme

dominiquemariano avatar May 29 '23 14:05 dominiquemariano

I'm closing this issue since this duplicates the issue already described in https://github.com/gocodebox/lifterlms/issues/392. In particular, this is covered by Any dates displayed on frontend should utilize WP default blog settings in https://github.com/gocodebox/lifterlms/issues/392

dominiquemariano avatar May 31 '23 09:05 dominiquemariano

Reopening to verify. If dates are parsed wrong on in the DB/frontend that's a bigger issue than just fixing the display via #2447

brianhogg avatar Dec 20 '24 15:12 brianhogg