lib/parseShowlistHtml.js
/*

  Get a TZ-ed date from the date header on showlist

*/
Get a TZ-ed date from the date header on showlist
Get a TZ - ed date from the date header on showlist
function dateFromHeader($header)
{
  const match = $header.text().match(/(\S+) ?(\d+)[,\.] ?(\d+)/);
  if (!match) {
    throw new Error('Unable to parse date header: ' + $header.html());
  }
  const [ , month, date, year ] = match;
  const m = moment.tz(`${month} ${date} ${year}`, 'MMMM DD YYYY', 'America/Chicago');
  return m;
}
function dateFromHeader ( $header ) { const match = $header . text ( ) . match ( / (\S+) ?(\d+)[,\.] ?(\d+) / ) ; if ( ! match ) { throw new Error ( 'Unable to parse date header: ' + $header . html ( ) ) ; } const [ , month , date , year ] = match ; const m = moment . tz ( ` ${ month } ${ date } ${ year } ` , 'MMMM DD YYYY' , 'America/Chicago' ) ; return m ; }
Get a TZ-ed date from the date header on showlist
Get a TZ - ed date from the date header on showlist