You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.
Describe the bug
The ConditionOperator.LastMonth condition operator brings back different results depending on the time component of the date being queried.
To Reproduce
Today is the 31st March 2021.
If I create a record with a date column with this value:
28/02/2021 00:00:00
then the condition operator ConditionOperator.LastMonth retreives the record.
If I create a record with a date column with this value:
28/02/2021 12:06:18
then the condition operator does not return the record.
Expected behavior
Both of these dates should be found by the query, as they are both in the last month: February.
Both of these dates are found when querying a real v9 instance of CRM.
** FakeXrmEasy and Dynamics 365 / CRM version **
v9
Screenshots
Here's a screenshot of a query where the date is set to an exact date, no time component - 28/02/2021 00:00:00
You can see that the query returns one row:
Here's a screenshot of a query where the date is set to date with a time - 28/02/2021 12:11:25
You can see that no rows are returned:
Both of these queries should return one row when using the 'last month' criteria.
The text was updated successfully, but these errors were encountered:
I can't quite work out why this is happening. These tests have been working for weeks, and suddenly stopped working. I think it must either be because we're near a month boundary and the number of days in the previous month is less than the number of days in this month, or because we (in the uk) have just switched to daylight saving, or something like that. Date related tests are always tricky - they have a habit of working on some days and not others! I'll try to remember to test it every day and see if they start working again on 1st of April...
The tests are succeeding again this morning, no doubt because it is the first of a new month (1st April).
I will reinstate the tests in my build pipeline and see if/when they fail in the future, although we may not see this for a while because we don't commit to this pipeline every day.
I may have to just rewrite the tests by making sure the date I create is on (say) the 1st of the previous month, rather than using Today.addmonths(-1). That would stop the build failing but it wouldn't fix the problem with FakeXrmEasy.
Describe the bug
The ConditionOperator.LastMonth condition operator brings back different results depending on the time component of the date being queried.
To Reproduce
Today is the 31st March 2021.
If I create a record with a date column with this value:
28/02/2021 00:00:00
then the condition operator ConditionOperator.LastMonth retreives the record.
If I create a record with a date column with this value:
28/02/2021 12:06:18
then the condition operator does not return the record.
Expected behavior
Both of these dates should be found by the query, as they are both in the last month: February.
Both of these dates are found when querying a real v9 instance of CRM.
** FakeXrmEasy and Dynamics 365 / CRM version **
v9
Screenshots
Here's a screenshot of a query where the date is set to an exact date, no time component - 28/02/2021 00:00:00
You can see that the query returns one row:
Here's a screenshot of a query where the date is set to date with a time - 28/02/2021 12:11:25
You can see that no rows are returned:
Both of these queries should return one row when using the 'last month' criteria.
The text was updated successfully, but these errors were encountered: