The subscribedDate filter used to be completely separate and it's now
been consolidated into SubscriberDateField. Since existing filters exist
in the wild that have the subscribedDate type, we're not able to
update the value to be consistent with the other types.
MAILPOET-4989
The settings controller is used internally in the Settings factory.
It has an in-memory cache, so on the test runner side, we need to reset
the cache after every test to ensure tests don't influence each other.
[MAILPOET-5480]
The 3rd party date picker component used on the send page for scheduling newsletter
uses date-fns. The date-fns works with different date formatting strings so we need to convert
WordPress date format to compatible one with date-fns.
This commit improves the conversion function to support all possible WP formats.
I fed all possible date format characters I found in https://wordpress.org/documentation/article/customize-date-and-time-format
(a A g h G H i s T c r U d j S l D m n F M Y y) to the custom date format setting
and I added replacement for all that broke the date scheduling component.
[MAILPOET-5472]
I found that we already have a global variable mailpoet_date_format defined in layout.html
so I removed duplicate mailpoet_date_display_format and used the global one directly.
The global one is set correctly using wp_date_format()|escape('js')
instead of incorrect wp_datetime_format()|escape('js')
[MAILPOET-5472]
In a previous commit, the name of the parameter of a few filters was
changed to `days`. This commit adds a migration to change the name of
parameter of existing filters when needed. The following parameters
should be renamed to days:
- number_of_orders_days
- total_spent_days
- single_order_value_days
- average_spent_days
I opted to leave the original parameter instead of deleting it, just to
be safe in case a given site needs to rollback to a previous version.
Once a change is made to a filter by the user, the old parameter will be
deleted.
[MAILPOET-4991]