예제 #1
0
        public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
            CultureInfo info = new CultureInfo("fa-Ir");

            PersianCultureHelper.SetPersianOptions(info);
            Thread.CurrentThread.CurrentCulture = info;
            string str = DateTime.Now.ToString("yyyy/MM/dd");
        }
예제 #2
0
        /// <summary>
        /// Set the page culture and load calendar if required
        /// </summary>
        protected override void InitializeCulture()
        {
            string lang = SnitzCookie.GetDefaultLanguage();

            if (lang != null)
            {
                Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(lang);
                Thread.CurrentThread.CurrentCulture   = CultureInfo.CreateSpecificCulture(lang);
            }
            if (Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName == "fa")
            {
                CultureInfo info = Thread.CurrentThread.CurrentCulture;
                PersianCultureHelper.SetPersianOptions(info);
                Thread.CurrentThread.CurrentCulture = info;
            }
            base.InitializeCulture();
        }