code: function encodeDate(date) {
  	if (!(date instanceof Date)) throw new Error('Value not Date: ' + date)
  	return (date.getUTCFullYear() * monthsPerYear + date.getUTCMonth()) - yearMonthZero
  }
docs: get linearValue from Date object