ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
DateTimePicker changing time, Value is shown empty when using Taiwan culture
Title:
B
I
{code}
?
This is my code: @Html.Awe().DateTimePicker(new DateTimePickerOpt { Name = "DateTime1", Value = DateTime.UtcNow}) When picking a new date or a different time from the DateTimePicker popup the value of the editor will become empty.
Save Changes
Cancel
RayBen
asked at 08 Jan 2024
ok, I was able to reproduce the problem by setting the CurrentCulture to "zh-TW"
at 22 Jan 2024
Omu
So what should I do, waiting for your updated version!
at 22 Jan 2024
RayBen
the time format for zh-TW has "tthh:mm" without separator (space after tt), something we're not handling in awem.js date time formatting, we'll let you know as soon as the js is fixed.
at 22 Jan 2024
Omu
Answers
B
I
{code}
?
Please download the zip archive from here: https://files.fm/u/s4rvykydd8 it contains a modified `awem.js` and an `awedict.zh-TW.js` file which you'll have to reference after `awem.js` (in our demo a different awedict file is referenced depending on the value of the Lang dropdown) Feel free to modify the content of the awedict file, we copied the english one and only added what was necessary for the AM PM to work.
Save Changes
Cancel
Omu
answered at 22 Jan 2024
I changed it according to your method, but it also produced wrong results. http://shuomaotec.com/AweMvc577/DateTimePicker_ERROR08.png http://shuomaotec.com/AweMvc577/DateTimePicker_ERROR09.png http://shuomaotec.com/AweMvc577/DateTimePicker_ERROR10.png http://shuomaotec.com/AweMvc577/DateTimePicker_ERROR11.png Please help to see how to solve the problem
at 22 Jan 2024
RayBen
I've edited my answer, please try the new download link, this time a demo is also included (after running the demo, select Chinese in the Lang dropdown)
at 22 Jan 2024
Omu
Thank you for giving me the files about ASP.NET Core. Can you please give me the files related to ASP.NET MVC5? Thank you!!
at 23 Jan 2024
RayBen
I downloaded the new ASP.NET Core file you gave me and executed it, but an error still occurred. There was a problem with DateTimePicker and TimePicker at the same time. Please test again and check. http://shuomaotec.com/AweMvc577/DateTimePicker_ERROR12.png
at 23 Jan 2024
RayBen
the modified files are js, they are the same for mvc 5 and core, make sure the old js files are not cached, do a hard refresh (Ctrl+Shift+R), also make sure you select the last option in the Lang dropdown when running de demo you've downloaded from the link above https://youtu.be/K_PFyHj2XC0
at 23 Jan 2024
Omu
This is the result of my test of the updated program you gave me. Please watch it. https://www.youtube.com/watch?v=2ZqJrFmlikI
at 23 Jan 2024
RayBen
I pressed CTRL+F5 and CTRL+SHIFT+R
at 23 Jan 2024
RayBen
could you please put this code in your home/index.cshtml and tell me what was rendered on your machine: @{ var cc = CultureInfo.CurrentCulture; var dtformat = cc.DateTimeFormat.AMDesignator + " " + cc.DateTimeFormat.PMDesignator; var cName = cc.Name; var cUIName = CultureInfo.CurrentUICulture.Name; var dt = cc.DateTimeFormat.ShortDatePattern + " " + cc.DateTimeFormat.ShortTimePattern; } <div> dtFormat: @dtformat<br/> cName: @cName<br/> cUIName: @cUIName <br/> dt: @dt<br/> </div>
at 23 Jan 2024
Omu
in my case it is: dtFormat: 上午 下午 cName: zh-TW cUIName: zh-TW dt: yyyy/M/d tth:mm also please have a look in the browser console if you're getting any errors (F12 in chrome)
at 23 Jan 2024
Omu
also it looks like some elements are not rendered correctly on the page (the feedback button, hamburger button), could you try private browsing (Ctrl+Shift+N), and a different browser, are you using any plugins that modify the html ?
at 23 Jan 2024
Omu
This is the response I executed dtFormat: 上午 下午 cName: zh-TW cUIName: zh-TW dt: yyyy-MM-dd tt hh:mm The screen I used Ctrl+Shift+N is as follows http://shuomaotec.com/AweMvc577/DateTimePicker_ERROR13.png browser console no any message
at 24 Jan 2024
RayBen
I've updated my answer, please try to download from the new link https://files.fm/u/s4rvykydd8
at 24 Jan 2024
Omu
Thank you very much. It works normally.
at 24 Jan 2024
RayBen
The ASP.NET Core version is available, but ASP.net MVC5 cannot be used. What should I do?
at 24 Jan 2024
RayBen
only the dll files are different between core and mvc5, you can download them from your profile
at 24 Jan 2024
Omu
After I download the personal file, do I also change the awem.js and awesome.zh-TW.js of the patch?
at 24 Jan 2024
RayBen
yes, you replace the old awem.js from your profile with the new one from the patch, and also add the awedict.zh-TW.js file
at 24 Jan 2024
Omu
How do I adjust the width of the DateTimePicker, the current input width is too small?
at 24 Jan 2024
RayBen
depends on your css, in our demo in `site.css` you can find `.einput .awe-field, ... { min-width: 15em` and you could change that value `.awe-field` is css class used by all the editors
at 24 Jan 2024
Omu
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK