sbstjn / timesheet.js

JavaScript library for HTML5 & CSS3 time sheets

Home Page:https://sbstjn.github.io/timesheet.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle years less than 100. (Y2k bug)

jbaber opened this issue · comments

From the example,

  new Timesheet('timesheet', 100, 105, [
    ['103', 'Had very bad luck'],
    ['10/103', '106', 'At least had fun', 'dolor'],
    ['02/105', '05/106', 'Enjoyed those times as well', 'ipsum'],
    ['07/105', '09/105', 'Bad luck again', 'default'],
    ['10/105', '108', 'For a long time nothing happened', 'dolor'],
    ['01/108', '05/109', 'LOST Season #4', 'lorem'],
    ['01/109', '05/109', 'LOST Season #4', 'lorem'],
    ['02/110', '05/110', 'LOST Season #5', 'lorem'],
    ['09/108', '06/110', 'FRINGE #1 & #2', 'ipsum']
  ]);

works fine, but

  new Timesheet('timesheet', 50, 55, [
    ['53', 'Had very bad luck'],
    ['10/53', '56', 'At least had fun', 'dolor'],
    ['02/55', '05/56', 'Enjoyed those times as well', 'ipsum'],
    ['07/55', '09/55', 'Bad luck again', 'default'],
    ['10/55', '58', 'For a long time nothing happened', 'dolor'],
    ['01/58', '05/59', 'LOST Season #4', 'lorem'],
    ['01/59', '05/59', 'LOST Season #4', 'lorem'],
    ['02/60', '05/60', 'LOST Season #5', 'lorem'],
    ['09/58', '06/60', 'FRINGE #1 & #2', 'ipsum']
  ]);

yields a blank timeline with correct years marked.

I see from the code it's because it's actually interpreting '53' as '1953'.