Quantcast
Viewing all articles
Browse latest Browse all 38

Answer by Tarmil for Pattern match multiple dates

when can be added to a whole pattern, not to nested patterns, so you need something like this:

match (startDate, endDate) with| d, e when d = DateTime.MinValue && e = DateTime.MinValue -> 0| _ -> 1

Note that in this case, pattern matching is not really necessary, and you can go for a simpler if:

if d = DateTime.MinValue && e = DateTime.MinValue then    0else    1

Viewing all articles
Browse latest Browse all 38

Trending Articles



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