InputTime
InputTime
Custom Time
This sample shows how to customize time items by binding an collection.
Features
Description
This sample shows how to customize time items by binding an collection.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; namespace MvcExplorer.Controllers { public partial class InputTimeController : Controller { public ActionResult CustomTime() { ViewBag.TimeList = new List< object > { "8:20" , "10:00" , "11:35" , "12:08" , "13:25" , "13:30" , "14:26" }; return View(); } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | @ { var timeList = ViewBag.TimeList as List< object >; DateTime dt = DateTime.Parse( "11:35" ); } < div > < label > @Html .Raw(InputTimeRes.CustomTime_Text0)</ label > < c1-input-time value = "dt" format = "H:mm" > < c1-items-source source-collection = "timeList" ></ c1-items-source > </ c1-input-time > </ div > @section Description{ @Html .Raw(InputTimeRes.CustomTime_Text1) } |