Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Is there any way to change date format ? #10636


User avatar
0
shedspotter created

Prerequisites

  • What is your product version? => 10.3.0
  • What is your product type? => Angular
  • What is product framework type? => .net core

Hi ASP.NET Zero team, Is there any way to change date format from dd/mm/yyyy to mm/dd/yyyy ? Note: urgent requirment. Thanks


4 Answer(s)
  • User Avatar
    0
    shedspotter created

    Also, can we make this setting availble to the tenant admins so they can set it as per their need?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @shedspotter

    The date format is determined according to selected culture. AspNet Zero doesn't support changing the date format out of the box rather than chaging it using the current culture/language. If you want to use a different format for the selected culture/language, you need to change it both on server and client side but I don't suggest this approach because it will be very problematic.

    Could you eplain which language you are using and why do you want to change the date format ?

    Thanks,

  • User Avatar
    0
    shedspotter created

    Hi @ismcagdas, Thanks for quick response 🙂 Could you explain why it will be very problematic ? Becase, I shall use formating on client side only. Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If it is only the client side for displaying the date values, you can just provide the format when you are displaying the date as shown below;

    {{ date | date: 'dd-MM-yyyy'}}
    

    and you can also change the momentFormat or luxonFormat pipes depending on your version.

    It would be problematic if you want to change it on the server side as well :).