diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-09-06 23:04:13 -0700 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-09-06 23:11:58 -0700 |
commit | d8bd57901e33a7057e26e782e295099ffcc0da89 (patch) | |
tree | e12dfc8cad42b1576756d19d7fbfd82646a009bf /webapp/utils/license_utils.jsx | |
parent | 7bc8e9a08dfde56387f946fdf5086252aa4d0491 (diff) | |
download | chat-d8bd57901e33a7057e26e782e295099ffcc0da89.tar.gz chat-d8bd57901e33a7057e26e782e295099ffcc0da89.tar.bz2 chat-d8bd57901e33a7057e26e782e295099ffcc0da89.zip |
Removing webapp
Diffstat (limited to 'webapp/utils/license_utils.jsx')
-rw-r--r-- | webapp/utils/license_utils.jsx | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/webapp/utils/license_utils.jsx b/webapp/utils/license_utils.jsx deleted file mode 100644 index a44cfb9d4..000000000 --- a/webapp/utils/license_utils.jsx +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -import LocalizationStore from 'stores/localization_store.jsx'; - -const LICENSE_EXPIRY_NOTIFICATION = 1000 * 60 * 60 * 24 * 60; // 60 days -const LICENSE_GRACE_PERIOD = 1000 * 60 * 60 * 24 * 15; // 15 days - -export function isLicenseExpiring() { - if (window.mm_license.IsLicensed !== 'true') { - return false; - } - - const timeDiff = parseInt(global.window.mm_license.ExpiresAt, 10) - Date.now(); - return timeDiff <= LICENSE_EXPIRY_NOTIFICATION; -} - -export function isLicenseExpired() { - if (window.mm_license.IsLicensed !== 'true') { - return false; - } - - const timeDiff = parseInt(global.window.mm_license.ExpiresAt, 10) - Date.now(); - return timeDiff < 0; -} - -export function isLicensePastGracePeriod() { - if (window.mm_license.IsLicensed !== 'true') { - return false; - } - - const timeDiff = Date.now() - parseInt(global.window.mm_license.ExpiresAt, 10); - return timeDiff > LICENSE_GRACE_PERIOD; -} - -export function displayExpiryDate() { - const date = new Date(parseInt(global.window.mm_license.ExpiresAt, 10)); - return date.toLocaleString(LocalizationStore.getLocale(), {year: 'numeric', month: 'long', day: 'numeric'}); -} |