timesheet.js
timesheet.js copied to clipboard
Handle years less than 100. (Y2k bug)
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'.