Skip to content

[* DateTimeV2] Fix date range (without year) is processed as a single Date with Year (#2850)#2907

Merged
tellarin merged 1 commit into
microsoft:masterfrom
aitelint:#2850
May 16, 2022
Merged

[* DateTimeV2] Fix date range (without year) is processed as a single Date with Year (#2850)#2907
tellarin merged 1 commit into
microsoft:masterfrom
aitelint:#2850

Conversation

@aitelint
Copy link
Copy Markdown
Contributor

Fix to issue #2850 in NL|EN|FR|DE|IT|PT|ES

Test cases added to DateTimeModels.

@veonua
Copy link
Copy Markdown

veonua commented Apr 10, 2022

could you please merge this

"Resolution": {
"values": [
{
"timex": "(XXXX-11-19,XXXX-11-20,P1D)",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolution is incorrect? Should be P2D start in 19 (inclusive) and ends in 21 (not inclusive).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this case different from some other behaviour? We may have a breaking problem here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's another big topic - the date range resolutions are messed up,
there is no clear rule when the last day/week/month is inclusive or not.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how the parsing of this pattern is currently implemented.
There are similar cases in the specs that follow the same logic, for example:

  • "I'll be out from 4-23 in next month" -> (2016-12-04,2016-12-23,P19D)
  • "I'll be out between 3 and 12 of Sept hahaha" -> (XXXX-09-03,XXXX-09-12,P9D)
  • "APEC will happen in Korea on November 18-19" -> (XXXX-11-18,XXXX-11-19,P1D)
  • "9 to 12 of June: another tapa festival" -> (XXXX-06-09,XXXX-06-12,P3D)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Some could be considered ambiguous, but some seem clearly incorrect. Let's not modify for now though, as this is somewhat of a breaking change.

"Resolution": {
"values": [
{
"timex": "(XXXX-11-19,XXXX-11-20,P1D)",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect resolution. Text clearly implies P2D.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we modify this behavior?
But it will affect other existing test cases (like the ones pointed above)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to add a flag if the last day must be included.

Because at this moment extra day is added for months and years (I will be off in April -> ends 1st of May)
But for weeks and days it’s not included (April 1-30 -> ends 30 Apr)

while I (human) read both of these cases the same

Copy link
Copy Markdown
Contributor Author

@aitelint aitelint May 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tellarin, @veonua, should we address this in a separate issue? (since the parsing problem is not related to the bug solved here)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

date resolution is much bigger issue and should be solved in separated issue. please merge this PR

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aitelint Yes, changes will come as part of another issue. Let me create one soon. We're discussing alternatives as it can be considered a breaking change.

@tellarin
Copy link
Copy Markdown
Collaborator

@aitelint Can you resolve these conflicts? Thanks.

@aitelint
Copy link
Copy Markdown
Contributor Author

@aitelint Can you resolve these conflicts? Thanks.

conflicts solved

Copy link
Copy Markdown
Collaborator

@tellarin tellarin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as-is as to not modify existing behaviour and re-resolution is beyond the scope of the issue this PR fixes.

@tellarin tellarin merged commit 31bd8dd into microsoft:master May 16, 2022
@aitelint aitelint deleted the #2850 branch May 16, 2022 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants