I want to change format from mm/dd/yyyy to dd/mm/yyyy when i click choose date in date controll with input type="date". Please show me how to do that. I want to show 24/04/2021 in this controll.
- ABP Framework version: v5.13.0
- UI type: Angular
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Steps to reproduce the issue:
2 Answer(s)
-
0
Hi @devteam
The
DateParserFormatter
exposed by@abp/ng.core
package sets the ng-bootstrap's date format. You can see this: https://github.com/abpframework/abp/blob/dev/npm/ng-packs/packages/theme-shared/src/lib/utils/date-parser-formatter.ts#L51It gets the date format from application-configuration response (
applicationConfiguration.localization.currentCulture.dateTimeFormat.shortDatePattern
). So the date format is determined from the backend according to current language. You can change the format in the backend or override theDateParserFormatter
class in the Angular UI like this:// app.module.ts import { DateParserFormatter } from '@abp/ng.core'; //... providers: [{provide: DateParserFormatter, useClass: YourDateParserFormatter}]
@maliming will help you for the backend configuration.
-
0
hi
For backend
Override the
AbpApplicationConfigurationAppService
service and replace the following method:https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs#L25 https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs#L184 https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationAppService.cs#L221