score:0

<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>

score:0

const currentExpiry = license.current.expiry;
now = moment();
periodEnd = moment(currentExpiry);
daysRemaining = Math.abs(now.diff(periodEnd, "days"));
daysOfMonth = moment().endOf('month').format('DD');
percentageOfRemainingDays = (daysRemaining / daysOfMonth) * 100;
console.log(`Remaining days :${daysRemaining} and percentage of remaining days :${percentageOfRemainingDays}`);

score:0

<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>

Related Query

More Query from same tag