I'm trying to get todays datetime (YYYY-MM-DD) to show up as default in my box where I choose date. Any ideas what I can do to show the MAX part as todays date by default. Guess I can create a variable and set it to today's date and use it but are there any easier way, like I'm trying to do it with a max="something"??
<input type="date" asp-for="MovingAverageViewModel.StartDate" id="StartDateAnvanceradSMA" value="MovingAverageViewModel.StartDate" class="form-control" max="DateTime.Now.ToShortDateString();" min="2017-01-01" />
value="MovingAverageViewModel.StartDate"(never set thevalueattribute when using a TagHelper - its already done by the helper). And to format it asyyyy-MM-ddthen useDateTime.Today.ToString("yyyy-MM-dd")asp-for="MovingAverageViewModel.StartDate"means you binding to the value of your property which add thevalueattribute (do not set it yourself under any circumstances). As for themaxdate- try it )