SemanticMediaWiki / SemanticResultFormats

Provides additional visualizations (result formats) for Semantic MediaWiki
https://www.semantic-mediawiki.org/wiki/Extension:Semantic_Result_Formats
Other
45 stars 75 forks source link

iCalendar DTEND year stays same in case date is computed #826

Open apolitze opened 3 months ago

apolitze commented 3 months ago

Hi SMW developers,

while testing I exported an iCalender date that had a DTSTART 20241231 and was wondering why the year for DTEND stays the same, if the enddate is computed: 2024-04-02_iCal

and I had a look into the iCalendar > DateParser, where it looks like $year might be updated in case date is computed: https://github.com/SemanticMediaWiki/SemanticResultFormats/blob/6dd7e46c1913b6555d8ac2dd0ef8385d0e214709/src/iCalendar/DateParser.php#L40

Setup SMW: 4.0.2

Steps to reproduce:

  1. Add two properties of type [[Has type::Date]] and set them to last day of year e.g.:
    {{#set:Hat Startdatum|2024-12-31}}
    {{#set:Hat Endedatum|2024-12-31}}
  2. Ask and export the dates as iCalendar Result:
    {{#ask:
    [[{{PAGENAME}}]]
    |?Hat Startdatum=start
    |?Hat Endedatum=end
    |format=icalendar
    |title=Termin
    |description=Termin
    |searchlabel=iCal Export
    }}

Expected:

  1. Termin.ics is exported and contains a calculated DTEND:20250101. Same behaviour that the next day is calculated as DTEND as if other dates are chosen.

Current:

  1. Termin.ics is exported and contains a calculated DTEND:20240101, which is invalid because it is before the DTSTART:20241231

Can someone check this please?