Giter Site home page Giter Site logo

Comments (5)

visualxl avatar visualxl commented on August 17, 2024

Nope. This is a bug. I spent a couple of hours on this since I am very new to JavaScript.

Do this under ics.js, and it will work fine:

//var start_seconds = ("00" + (start_date.getMinutes().toString())).slice(-2); //original
var start_seconds = ("00" + (start_date.getSeconds().toString())).slice(-2); //added by Syahmul

//var end_seconds = ("00" + (end_date.getMinutes().toString())).slice(-2); //original
var end_seconds = ("00" + (end_date.getSeconds().toString())).slice(-2); //added by Syahmul

To the one who is maintaining this repo, you may want to fix this bug as suggested here, and I hope it helps. :)

from ics.js.

lynchkevin avatar lynchkevin commented on August 17, 2024

It's not just that he is using .getMinutes() instead of .getSeconds his test also forgets the hours.
karanveerm is exactly right if you change the code it does work but I also have not tested it exhaustively.
Cost me as much time as this library saved me.

from ics.js.

olafvanzon avatar olafvanzon commented on August 17, 2024

I just created a pull request to fix this issue with solution suggested by @karanveerm.

@nwcell can you check? thanks

from ics.js.

keiichi428 avatar keiichi428 commented on August 17, 2024

So it's been 2 years since last post, but following change worked for me 👍

// if (start_minutes + start_minutes + start_seconds + end_minutes + end_seconds != 0) {
           if (start_hours +start_minutes + start_minutes + start_seconds + end_minutes + end_seconds != 0) {
               start_time = 'T' + start_hours + start_minutes + start_seconds;
               end_time = 'T' + end_hours + end_minutes + end_seconds;
           }

from ics.js.

nwcell avatar nwcell commented on August 17, 2024

Fixed

from ics.js.

Related Issues (20)

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.