From e7b91b550f23e789540f79a8d1c65f9619801217 Mon Sep 17 00:00:00 2001 From: Aditya Anand M C Date: Tue, 23 Mar 2021 16:02:20 +0530 Subject: [PATCH] ensure bounty time left shows expired when bounty has expired --- app/assets/v2/js/pages/bounty_details2.js | 6 ++++++ app/dashboard/templates/bounty/details2.html | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/assets/v2/js/pages/bounty_details2.js b/app/assets/v2/js/pages/bounty_details2.js index 808023b9312..098ebd09316 100644 --- a/app/assets/v2/js/pages/bounty_details2.js +++ b/app/assets/v2/js/pages/bounty_details2.js @@ -785,6 +785,12 @@ Vue.mixin({ }); } return activities; + }, + isExpired: function() { + return moment(document.result['expires_date']).isBefore(); + }, + expiresAfterAYear: function() { + return moment().diff(document.result['expires_date'], 'years') < -1; } } }); diff --git a/app/dashboard/templates/bounty/details2.html b/app/dashboard/templates/bounty/details2.html index 639d1e763e8..76636e4aa3e 100644 --- a/app/dashboard/templates/bounty/details2.html +++ b/app/dashboard/templates/bounty/details2.html @@ -101,7 +101,10 @@

{% trans "Time left" %} -