mirror of
https://github.com/Radarr/Radarr
synced 2024-12-29 11:25:26 +00:00
663160c06a
renamed NzbDrone.Backbone to UI
12 lines
No EOL
414 B
JavaScript
12 lines
No EOL
414 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.isAfter(Date.create('tomorrow')) && date.isBefore(Date.create().addDays(7))) return date.format('{Weekday}');
|
|
|
|
return date.format('{MM}/{dd}/{yyyy}');
|
|
} |