Skip to content
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

Explicit support for the common date formats of yyyy-mm-dd and yyyy-dd-mm #191

Closed
SebastianMC opened this issue Jan 14, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@SebastianMC
Copy link
Owner

Background

At glance, the \-d+ seems to be equivalent to the above formats, yet there is a subtle difference.
When the regexp matches are expanded, the \-d+ is treated as a number and uses number-specific expansion. For example 2012-11-14 is expanded to a title prefix of 00002012|00000011|00000014// (or similar, example to show the idea).

This works for sorting in general, yet when there is a need to mix this sorting with date-based suffixes of prefixes, there is a problem.

Namely, the explicit date patterns are expanded to ISO date format, so for the pattern \[Mmm-dd-yyyy] and a match of Nov-14-2012 the title prefix generated is 2012-11-14//. This obviously will not sort correctly with title prefix as 00002012|00000011|00000014//

Goal

The common date formats of yyyy-mm-dd and yyyy-dd-mm should allow mixing different date formats and prefix- plus suffix- notations within the same sorting rule

Specs

New syntax to introduce:

  • yyyy-mm-dd
  • yyyy-dd-mm

and the typical usage should be covered by integration tests:

---
sorting-spec: |
   /+ ... \[yyyy-Www (mm-dd)]
   /+ ... \[yyyy-Www]
   /+ ... mm-dd \[yyyy-mm-dd]
   /+ ... dd-mm \[yyyy-dd-mm]
   /+ ... \[yyyy-mm-dd]
   /+ ... \[Mmm-dd-yyyy]
   /+ \[dd-Mmm-yyyy] ...
     > a-z
---
SebastianMC added a commit that referenced this issue Jan 14, 2025
- more unit tests
#191 - added two obvious date formats yyyy-mm-dd and yyyy-dd-mm
@SebastianMC SebastianMC self-assigned this Jan 14, 2025
@SebastianMC SebastianMC added the enhancement New feature or request label Jan 14, 2025
SebastianMC added a commit that referenced this issue Jan 14, 2025
SebastianMC added a commit that referenced this issue Jan 14, 2025
…patterns

#178 - week-number based date extraction patterns for titles, incl. Www, Www- and Www+ specs
#191 - Explicit support for the common date formats of `yyyy-mm-dd` and `yyyy-dd-mm`
@SebastianMC
Copy link
Owner Author

Plugin release 3.1.1 comes with this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant