I've got an app to manage rents. The lease periods are:
List<String> rentPeriods = [
'daily',
'weekly',
'bimonthly',
'monthly',
'2_months',
'quarterly',
'biannual',
'annual',
];
I need to display how many payments will the user have for that lease. For daily and weekly I do something like this:
final dailyPayments = to.difference(from).inDays;
final weeklyPayments = to.difference(from).inDays / 7;
But when I need to calculate months how could I do it? I can't just divide it by 30