Base solution for your next web application
Open Closed

Date Localization in Azure #3175


User avatar
0
paymanrowhani created

Hello guys,

I have a asp zero website with 2 languages: English and Persian. When I change the language, it correctly changes the date. For example, when I set to English, the date will be rendered as the Gregorian date "05/12/2017" and when I switch the language to Persian it will be rendered as the Persian (Hijri Shamsi) date "02/22/1396". So everything works well in my local env. However, I have published my app into an Azure VM and it does not render date correctly. All languages change correctly (UI Culture), but the date is always rendered as the Gregorian date "05/12/2017". Perhaps Culture is not changed correctly. Note that I'm using the ASP.NET MVC (.net core) version. What shall I do to fix it?

Thanks, Payman


7 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you check that if your Azure VM's operating system has persian language installed or not ?

    Thanks.

  • User Avatar
    0
    paymanrowhani created

    Hi,

    It has installed it and it correctly shows the translated texts in Persian when I choose Persian language in the website.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Actually we didn't do anything special for supporting hijri dates. In our demo it is also showing gregorian dates when you select persian language.

    Have you contacted with azure if they support this or not ?

    Thanks.

  • User Avatar
    0
    paymanrowhani created

    Hi,

    Well, after some investigations I found that despite Windows 10, Windows Server 2012 R2 (on Azure VM) does not support Persian calendar and I think that is the problem, because it works well on my Windows 10. I noticed that someone else had already asked about the issue and it is left unanswered: <a class="postlink" href="http://stackoverflow.com/questions/36400581/add-persian-calendar-to-windows-server-2012-r2">http://stackoverflow.com/questions/3640 ... er-2012-r2</a>

    Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks for the fast response :), I was saerching for the reason.

  • User Avatar
    0
    paymanrowhani created

    You're welcome :)

  • User Avatar
    0
    zokho created

    Hi Payman, Any chance that you share your solution of switching calendars Eng<>Persian? What Angular component did you end up using for the DatePicker? I have already found this [https://github.com/fingerpich/jalali-angular-datepicker]) but it is a bit buggy!

    Thanks in advance ;)