Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Reopened Unassigned: [AttributeRouting]Provide ability for user to specify date format when using DateTime route constraint [979]

$
0
0
Currently the datetime constraint accepts datetime in the format "mm-dd-yyyy" (btw, hyphen is not mandatory, can have '.' too as a separator), it would be useful if we provide a way for user to specify what kind of format do they expect...ex: dd-mm-yyyy or yyyy-mm-dd etc.

```
[HttpGet("getdata/{dt:datetime}")]
public string GetData(DateTime dt)
{
return "GetData:" + dt.ToString();
}
```

Yeah, a user could always write a custom date time constraint easily to achieve this, but that makes our default constraint not much useful in the end.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>