1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-21 01:49:57 +02:00
Sonarr/NzbDrone.Backbone/Mixins/spoon.js
Mark McDowall da2c0d1d65 Calendar colouring, upcoming list shows yesterday
Cleaned up series file a bit.
Added spoon for common sugar tasks.
2013-02-28 20:59:06 -08:00

12 lines
373 B
JavaScript

function bestDateString(sourceDate){
if (!sourceDate) return '';
var date = Date.create(sourceDate);
if (date.isYesterday()) return 'Yesterday';
if (date.isToday()) return 'Today';
if (date.isTomorrow()) return 'Tomorrow';
if (date.isBefore(Date.create().addDays(7))) return date.format('{Weekday}');
return date.format('{MM}/{dd}/{yyyy}');
}