gocodebox / gocodebox/lifterlms
Correctly parse the date saved in Course Options > Restrictions > Enrollment Start Date based on WordPress Dashboard > Settings > General > Date Format.
- Dominant language
- PHP
- Stars
- 212
- Forks
- 140
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 19
Description
### 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
Contributor guide
Assessment
This issue has not been assessed yet.