feat: recurring deposit enhancements, dashboard, chart, and account view updates
This commit is contained in:
@@ -226,7 +226,15 @@ export class SettingsService {
|
||||
* Returns current Business date server
|
||||
*/
|
||||
get businessDate(): Date {
|
||||
return this.dateUtils.convertToDate(localStorage.getItem('mifosXServerDate'), SettingsService.businessDateFormat);
|
||||
// With business dates switched off the server works on today's date, so the screens must too - the date
|
||||
// stored from when it was on would otherwise linger. Nothing stored (or unreadable) also falls back to today
|
||||
// instead of an Invalid Date.
|
||||
if (this.businessDateConfig === 'false') {
|
||||
return new Date();
|
||||
}
|
||||
const stored = localStorage.getItem('mifosXServerDate');
|
||||
const date = stored ? this.dateUtils.convertToDate(stored, SettingsService.businessDateFormat) : null;
|
||||
return date && !isNaN(date.getTime()) ? date : new Date();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user