Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function toPersianDate (date, format) {
return '' + toPersianNumber(moment(date).locale('fa').format(format))
}
export default function toRelativeDate (date, format) {
return '' + toPersianNumber(moment(date, format).locale('fa').fromNow())
}
getConfig(config: IMonthCalendarConfig): IMonthCalendarConfig {
this.DEFAULT_CONFIG = (config.calendarSystem !== ECalendarSystem.gregorian) ?
this.JALALI_DEFAULT_CONFIG : this.GREGORIAN_DEFAULT_CONFIG;
moment.locale(this.DEFAULT_CONFIG.locale);
return {...this.DEFAULT_CONFIG, ...this.utilsService.clearUndefined(config)};
}