From 8163f730f4b195160b5b9ca4202c1f304ac68b27 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Tue, 27 Feb 2018 14:21:19 +0100 Subject: Internet Explorer and Edge compatibility fixes. --- src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main/kotlin/pl/treksoft/kvision/utils') diff --git a/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt b/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt index 335e0415..a25d8e06 100644 --- a/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt +++ b/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt @@ -26,6 +26,7 @@ package pl.treksoft.kvision.utils import pl.treksoft.kvision.KVManager import pl.treksoft.kvision.core.CssSize import pl.treksoft.kvision.core.UNIT +import kotlin.browser.window import kotlin.js.Date /** @@ -192,3 +193,9 @@ fun String.toDateF(format: String = "YYYY-MM-DD HH:mm:ss"): Date { fun Date.toStringF(format: String = "YYYY-MM-DD HH:mm:ss"): String { return KVManager.fecha.format(this, format) } + +/** + * Utility function to detect Internet Explorer 11. + * @return true if the current browser is IE11 + */ +fun isIE11(): Boolean = window.navigator.userAgent.matches("Trident\\/7\\.") -- cgit