-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
CRM-21050: Use datepicker for all date fields used in contribution backoffice form #10841
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, working fine.
This makes me sad. We really want to switch to datepicker rather than deal with this nasty handling. However, I'm ok for this to be merged after one clarification. It seems to me it is not receive_date (per the title of the PR) but rather trxn_date that is not being set correctly. Is that correct? If so can we correct that in the PR / JIRA? |
Agreed, but I've abandoned datepicker so many times as I cannot, for want of trying, get it to set a default date passed in from CiviCRM. With the old method this is easy! |
is this actually adding trxn_date to the form? If so it seems a bigger change than I realised |
@mattwire - this patch works on that form to convert thank you date & loads the default ok - does it offer you any clues as to the problem you were having? Note that the Contribution.xml already has metadata to describe the date field so I didn't need to add it |
@eileenmcnaughton there are three date fields displayed on the form, this ensures that all three have their correct time displayed rather than 12:00am for the part of the form we're talking about is the payment section. The before and after images show the payment trxn_date now get their time displayed unlike before. receive_date processing should be unchanged. |
Right - but I think if we fix any date fields we should change them to use the preferred datepicker at that point. We shouldn't fix the deprecated date field version - the patch above was the example of how to do that for one field |
2aa9de2
to
c08d817
Compare
@mattwire the confusing thing about switching to the new datpicker is that it uses a different format than the old method, which might mess up the defaults if you're dealing with legacy code. The old fields would use a localized format across 2 fields (one for date, one for time) which got complicated and messy. The new datepicker widget contains a standard ISO date/time value, which should be much easier to work with once you clear away the legacy stuff. |
Jenkins test this please |
@eileenmcnaughton @colemanw I have changed the JIRA title and description, because as per change it's an improvement to use datepicker for all date fields used in backoffice contribution. Also, I have shared a screencast above to show that the date field values are correctly submitted and set as default on the edit form. |
52daeb8
to
834e55b
Compare
@@ -757,23 +757,18 @@ public function testbyActivityDateAndStatus() { | |||
$lastWeekActivities = array(1, 2, 3); | |||
$todayActivities = array(4, 5, 6, 7); | |||
$lastTwoMonthsActivities = array(8, 9, 10, 11); | |||
$lastYearActivties = array(12, 13, 14, 15, 16); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be in a separate PR - even if we have to ignore the test fail for now
@@ -1203,8 +1203,6 @@ public function createContributionWithTax() { | |||
$form->testSubmit(array( | |||
'total_amount' => 100, | |||
'financial_type_id' => $financialType['id'], | |||
'receive_date' => '04/21/2015', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we update the format on these dates rather than remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eileenmcnaughton 2 reasons why I removed it:
- Provided the default value of current date time in the desired format here
- In these unit-tests receive date has no importance, however I have retained in some UT like here where it's needed.
Or do you still want to update their formats?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that seems fine - sounds like we are not losing any test data
Looks solid from a code POV - I haven't tested |
---------------------------------------- * CRM-21050: credit card invoice: receive time set to 12:00 https://issues.civicrm.org/jira/browse/CRM-21050
@eileenmcnaughton I have moved the additional UT failure fix in separate PR #11479 |
Jenkin test this please |
test failure is unrelated |
@civicrm-builder retest this please |
I'm satisfied with the amount of review this has seen. Adding "merge on pass" label. |
Test build failure is not related and fixed here #11479 |
Merging in accordance with merge on pass as fail is unrelated |
Thanks @eileenmcnaughton and @colemanw for your review and getting it merged :) |
Fatal error is displayed when a user tries to delete a contribution after this change. Raised a fix at #11500 |
CRM-21050: Use datepicker for all date fields used in contribution backoffice form
Overview
Use datepicker for datefields used in backoffice contribtution, these are:
Before
Date fields were using jcalender.
After
Replaced all the date fields with datepicker. Here's the screencast to show that default date values and correctly set after submission:
NOTE original PR was tackling this in a different way - hence comments don't appear to make sense.