aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_status/src/services/clearAtOptionsService.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_status/src/services/clearAtOptionsService.js')
-rw-r--r--apps/user_status/src/services/clearAtOptionsService.js52
1 files changed, 52 insertions, 0 deletions
diff --git a/apps/user_status/src/services/clearAtOptionsService.js b/apps/user_status/src/services/clearAtOptionsService.js
new file mode 100644
index 00000000000..af0059bfb7f
--- /dev/null
+++ b/apps/user_status/src/services/clearAtOptionsService.js
@@ -0,0 +1,52 @@
+/**
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+import { translate as t } from '@nextcloud/l10n'
+
+/**
+ * Returns an array
+ *
+ * @return {object[]}
+ */
+const getAllClearAtOptions = () => {
+ return [{
+ label: t('user_status', 'Don\'t clear'),
+ clearAt: null,
+ }, {
+ label: t('user_status', '30 minutes'),
+ clearAt: {
+ type: 'period',
+ time: 1800,
+ },
+ }, {
+ label: t('user_status', '1 hour'),
+ clearAt: {
+ type: 'period',
+ time: 3600,
+ },
+ }, {
+ label: t('user_status', '4 hours'),
+ clearAt: {
+ type: 'period',
+ time: 14400,
+ },
+ }, {
+ label: t('user_status', 'Today'),
+ clearAt: {
+ type: 'end-of',
+ time: 'day',
+ },
+ }, {
+ label: t('user_status', 'This week'),
+ clearAt: {
+ type: 'end-of',
+ time: 'week',
+ },
+ }]
+}
+
+export {
+ getAllClearAtOptions,
+}