markwhen icon indicating copy to clipboard operation
markwhen copied to clipboard

[Feature Request] Please add negative relative dates.

Open imesha10 opened this issue 2 years ago • 3 comments

Problem

Hello, currently there is support for relative dates but not negative relative dates. Sometimes I have an event to start 1 or 2 days before the previous event and continue forward a specified amount of time. Please add support to this or let me know if this is already something that can be done. I have read the documentation and didn't find anything regarding this.

Possible notation example:

group TestGroup: 2023-05-06/1 week: test item 1 -1 day/1 week: test item 2 endGroup

One more thing...

I use the vscode extension, if it's possible is there a way for me to manually update the parser?

imesha10 avatar May 06 '23 23:05 imesha10

Found a workaround. Quite messy, but it works (for me). I don't want to declare all that milestones. !work.end would be nice.

2025-05-01: start !start
!start 3 month: work !work
after !work: end !end
before !end 1 week: final tasks

grafik

h-brockmann avatar Jun 22 '24 07:06 h-brockmann

It will be nice also to have a task set for three days after te beginning of another. Just like this image

ManuelColombo avatar Oct 16 '24 10:10 ManuelColombo

This version breaks the view for me:

section Eras

group CE

0000-01-01: CE 0 !ce0

group BCE

before !ce0 271820 year: BCE 3_000_000_000 !bce1
before !bce1 271820 year: BCE 3_400_000_000

chozandrias76 avatar Nov 26 '24 19:11 chozandrias76

This is somewhat related to https://github.com/mark-when/markwhen/issues/97.

In your example @imesha10,

group TestGroup:
2023-05-06/1 week: test item 1
-1 day/1 week: test item 2
endGroup

the start of the second event is ambiguous - should it start one day before the prior event begins (2023-05-05) or one day before the prior event ends (2023-05-12)? There are probably people who want to be able to express both.

Similarly with @ManuelColombo's example, which should reference the start of the prior event.

This isn't a fully fleshed out thought but I'm wondering if adding a keyword with might work, where with means we're referring to the prior event's (or referenced event's) start time...

kochrt avatar Sep 25 '25 21:09 kochrt

And then in OP's example

group TestGroup:
2023-05-06/1 week: test item 1
-1 day/1 week: test item 2
endGroup

the second event would start 1 day before the prior event ended (2023-05-12), whereas writing with -1 day/1 week: test item 2 would have it start 1 day before the prior event started (2023-05-05)

🤔

kochrt avatar Sep 25 '25 22:09 kochrt

Ah yes, you are right I was ambiguous, I think previously when I made this issue I was thinking of the end datetime of the previous task.

Yes, a keyword like with would work.

If you want some ideas to throw into the mix, though this might be harder to implement, there is also the idea of this type of syntax:

  • Base: use key world from followed by task name
  • Use key word start of to specify that you would be referencing the start of the previous task
  • Use key word end of to specify that you would be referencing the end of the previous task.

Purpose: This way you could have one main task and two sub tasks that both start from an offset from the main task. Note this is optional, I'm just throwing it into the mix for ideas, not sure if people will use this for that.

# Example of only `from`
group TestGroup:
2023-05-06/1 week: test item 1
1 day from 'test item 1'/1 week: test item 2
endGroup


# Example of `start of`
group TestGroup:
2023-05-06/1 week: test item 1
1 day from start of 'test item 1'/1 week: test item 2
endGroup


# Example of `end of`
group TestGroup:
2023-05-06/1 week: test item 1
1 day from end of 'test item 1'/1 week: test item 2
endGroup


# Example of multi link
# Example of `end of`
group TestGroup:
2023-05-06/1 week: test item 1
1 day from end of 'test item 1'/1 week: test item 2
2 day from end of 'test item 1'/1 week: test item 3
endGroup

Oh I just looked at the other issue you referenced, yes that is similar, though the issue talks about a much more complex scenario where multiple conditions have to be correct for the item to start and end.

imesha10 avatar Sep 26 '25 23:09 imesha10

I added support for negative relative dates. Also look at https://github.com/mark-when/markwhen/issues/97

kochrt avatar Oct 12 '25 19:10 kochrt