InputDateTime
InputDateTime
Overview
This sample shows the basic usage of the InputDateTime control.
Features
Current culture:
Description
This sample shows the basic usage of the InputDateTime control.
This sample demos the usage of the method changeCulture at client side.
1 2 3 4 5 6 7 8 9 10 11 12 | using Microsoft.AspNetCore.Mvc; namespace MvcExplorer.Controllers { public partial class InputDateTimeController : Controller { public ActionResult Index() { return View(); } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | @ { var today = DateTime.Now.Date; } @section Scripts{ <script> function applyCulture() { var selCulture = document.getElementById( "selCulture" ); wijmo.changeCulture(selCulture.value).then(() => { if (selCulture.selectedOptions.length > 0) document.getElementById( "curCulture" ).textContent = selCulture.selectedOptions[0].label; }); } </script> @Html .C1().Scripts().Basic().Culture( "ja" ) @Html .C1().Scripts().Basic().Culture( "de" ) @Html .C1().Scripts().Basic().Culture( "fr" ) @Html .C1().Scripts().Basic().Culture( "ko" ) @Html .C1().Scripts().Basic().Culture( "en" ) } < div > < label > @Html .Raw(InputDateTimeRes.Index_Text0)</ label > < c1-input-date-time value = "@today" > </ c1-input-date-time > < br /> @Html .Raw(InputDateTimeRes.Index_Text21): < label id = "curCulture" style = "font-size:14px;font-weight:bold;" >English</ label > < select id = "selCulture" size = "5" style = "width:200px;padding:5px;" > < option value = "en" selected = "selected" >English</ option > < option value = "ja" >Japanese</ option > < option value = "de" >German</ option > < option value = "fr" >French</ option > < option value = "ko" >Korean</ option > </ select > < br /> < button id = "btn" onclick = "applyCulture()" > @Html .Raw(InputDateTimeRes.Index_Text22)</ button > </ div > @section Description{ < p > @Html .Raw(InputDateTimeRes.Index_Text1)</ p > < p > @Html .Raw(InputDateTimeRes.Index_Text2)</ p > } |