Skip to content

Commit

Permalink
Merge branch 'dev-mb' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
natsuozawa committed Mar 16, 2019
2 parents 4e2a689 + 354e27c commit 6c0452b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helpers/parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ exports.parseDeadlines = document => {

$('.agenda > .line').each((i, el) => {
const labels = [];
$(el).find('.label').each((i, label) => {
$(el).find('.label').each((j, label) => {
labels.push($(label).text().delNewlines());
});

Expand All @@ -54,7 +54,7 @@ exports.parseDeadlines = document => {
const dueHour = due.match(/[AP]M$/) === 'AM' ? due.match(/\d{1,2}(?=:\d{2})/)[0] : Number(due.match(/\d{1,2}(?=:\d{2})/)[0]) + 12; // if PM, add 12 hours
const dueDay = $(el).find('.day').text(); // Match from icon
const dueMonth = getMonthFromAbbr($(el).find('.month').text()); // Match from icon
const dueYear = $(el).parent().prev('h3').text().includes('Upcoming') ? guessFutureYear(dueMonth) : guessPastYear(dueMonth); // listed as upcoming deadline or past deadline
const dueYear = $(el).find('.date-badge').hasClass('past-due') ? guessPastYear(dueMonth) : guessFutureYear(dueMonth); // listed as upcoming deadline or past deadline

payload.push({
title: encodeURI($(el).find('h4.title').text().delNewlines()),
Expand Down

0 comments on commit 6c0452b

Please sign in to comment.