Code Monkey home page Code Monkey logo

Comments (9)

GiovanniSalmeri avatar GiovanniSalmeri commented on July 18, 2024

Yes, I am aware of the problem... When I wrote this little extension, the first use was for conferences and lectures in a University, which obviously never go past midnight (and never span several days without breaks). But before a future global overhaul I could write a little patch that at least could cope with the case of an event that goes past midnight. The logic could be: when the end time precedes the start time, it is interpreted as belonging to the following day. Would this be useful to you?

from yellow-diary.

pftnhr avatar pftnhr commented on July 18, 2024

That would be an acceptable work around. 😃

from yellow-diary.

GiovanniSalmeri avatar GiovanniSalmeri commented on July 18, 2024

Try changing line 58 like this:

$eventTime = strtotime($event[0]." ".$event[2]) + (strcmp($event[1], $event[2])>0 ? 86400 : 0);

And line 272 like this:

$end = gmdate($timeFormat, strtotime($event[0]." ".$event[2]) +  (strcmp($event[1], $event[2])>0 ? 86400 : 0));

This very simple patch works only if hours are always written with two digits (for example 09:30, not 9:30). In order to regenerate the wrong iCal files, it is sufficient to delete them. Not tested, should work...

Edit: corrected the obviously wrong code...

from yellow-diary.

pftnhr avatar pftnhr commented on July 18, 2024

It works like a charm, thank you very much!

from yellow-diary.

pftnhr avatar pftnhr commented on July 18, 2024

Rejoiced too soon. Now the ICS works but the website shows the end date as the event date.

from yellow-diary.

GiovanniSalmeri avatar GiovanniSalmeri commented on July 18, 2024

Now the ICS works but the website shows the end date as the event date.

Sorry, I will double-check as soon as possible!

from yellow-diary.

GiovanniSalmeri avatar GiovanniSalmeri commented on July 18, 2024

Please change also line 63 like this:

$getDate = getdate(strtotime($event[0]));

from yellow-diary.

pftnhr avatar pftnhr commented on July 18, 2024

Thanks a lot, it works!

If you're interested, take a look at: https://www.ckb-ev.de/veranstaltungen/

from yellow-diary.

GiovanniSalmeri avatar GiovanniSalmeri commented on July 18, 2024

I am glad it works as intended. Your page is very nice, thank you!

from yellow-diary.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.