Fuzzy Humanize date using Moment.js for datatable searching
What if you have three functions that each calculate the string on its own? Therefore:

function days_diff(daydiff) {
  if (daydiff==0) return 'Today'
  if (daydiff==1) return 'Tomorrow'
  if (daydiff==-1) return 'Yesterday'
  return null
}
function weeks_diff(daydiff) {
  if (daydiff &gt; 0 &amp;&amp; daydiff &lt; 7) return 'Thisweek'
  if (daydiff &lt; 7) return 'Nextweek'
  return null
  ...


Then you can have your one aggregate function that calls the three of them... 

Here's the much more complicated one from Rails that might provide guidance/inspiration: https://github.com/rails/rails/blob/2c97fbf6503c9199f3fe5ed06222e7226dc6fcd9/actionview/lib/action_view/helpers/date_helper.rb#L104