• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

wrong age in calendar module

Scheduled Pinned Locked Moved Troubleshooting
4 Posts 2 Posters 2.1k Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    chamaeleon82
    last edited by Dec 14, 2016, 6:24 PM

    hi,

    I´ve created google calendar as a birthday calendar. Birthday is created as an appointment (whole day, repeat every year). Start date is the birthday and year of birth.
    My problem is that the display of age is a year less. So instead of 35 years old only 34 is displayed (E.g. March 22th.).
    alt text
    Does anyone know this problem?

    P 1 Reply Last reply Dec 28, 2016, 8:08 PM Reply Quote 0
    • P Offline
      pert.no.more @chamaeleon82
      last edited by Dec 28, 2016, 8:08 PM

      @chamaeleon82 Same here. There is a logical bug in the calculation of “yearDiff” in calendar.js line 129-130. It calculates “CurrentYear” - “FirstYear of event” instead “NextOccurrenceYear of event” - “FirstYear of event”. I’m not too familiar with js, but the fix should be something like yearDiff = event.startDate.getFullYear() - event.firstYear.

      1 Reply Last reply Reply Quote 0
      • P Offline
        pert.no.more
        last edited by Dec 28, 2016, 9:28 PM

        for me it worked by replacing in line 129:

        new Date().getFullYear()

        with

        new Date(parseInt(event.startDate)).getFullYear()

        1 Reply Last reply Reply Quote 0
        • C Offline
          chamaeleon82
          last edited by Jan 15, 2017, 4:33 PM

          thank you, will soon try.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Enjoying MagicMirror? Please consider a donation!
          MagicMirror created by Michael Teeuw.
          Forum managed by Sam, technical setup by Karsten.
          This forum is using NodeBB as its core | Contributors
          Contact | Privacy Policy