DoesBrowserHaveNativeDatePicker

using System; using System.Web; using System.Web.Mvc; public static class MyExtensionMethods { public static bool DoesBrowserHaveNativeDatePicker(this HttpBrowserCapabilities browser) { if (browser == null) { return false; } switch (browser.Browser) { case "Chrome": // Google Chrome and Microsoft Edge return true; case "Firefox": case "InternetExplorer": return false; default: return false; } } }
This extension method is useful for web projects and you want to know if the user browser implements a native date picker.
Of course, it's definitely not final and could be easily broken.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.