Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: added reminder list item

ammarahm-edc06f3ed35101
diff --git a/apps/mobile/app/components/list-items/reminder/index.tsx b/apps/mobile/app/components/list-items/reminder/index.tsx
index 2935b4941..8db4a5c54 100644
--- a/apps/mobile/app/components/list-items/reminder/index.tsx
+++ b/apps/mobile/app/components/list-items/reminder/index.tsx
@@ -18,10 +18,135 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React from "react";
import { View } from "react-native";
+import { notesnook } from "../../../../e2e/test.ids";
import type { Reminder } from "../../../services/notifications";
+import { useThemeStore } from "../../../stores/use-theme-store";
+import { SIZE } from "../../../utils/size";
+import { Properties } from "../../properties";
+import { IconButton } from "../../ui/icon-button";
+import Heading from "../../ui/typography/heading";
+import Paragraph from "../../ui/typography/paragraph";
+import SelectionWrapper from "../selection-wrapper";
+import Icon from "react-native-vector-icons/MaterialCommunityIcons";
+import ReminderSheet from "../../sheets/reminder";
+import { formatReminderTime } from "../../../utils/time/index";
+
const ReminderItem = React.memo(
({ item, index }: { item: Reminder; index: number }) => {
- return <View />;
+ const colors = useThemeStore((state) => state.colors);
+ const openReminder = () => {
+ ReminderSheet.present(item);
+ };
+ return (
+ <SelectionWrapper
+ //@ts-ignore
+ index={index}
+ height={100}
+ onPress={openReminder}
+ item={item}
+ >
+ <View>
+ <Heading
+ numberOfLines={1}
+ style={{
+ flexWrap: "wrap"
+ }}
+ size={SIZE.md}
+ >
+ {item.title}
+ </Heading>
+
+ {item.description ? (
+ <Paragraph
+ style={{
+ flexWrap: "wrap"
+ }}
+ numberOfLines={2}
+ >
+ {item.description}
+ </Paragraph>
+ ) : null}
+
+ <View
+ style={{
+ flexDirection: "row"
+ }}
+ >
+ {item.mode === "repeat" ? (
+ <View
+ style={{
+ backgroundColor: colors.nav,
+ borderRadius: 5,
+ flexDirection: "row",
+ paddingHorizontal: 5,
+ paddingVertical: 3,
+ alignItems: "center",
+ marginTop: 5,
+ justifyContent: "flex-start",
+ alignSelf: "flex-start",
+ marginRight: 10
+ }}
+ >
+ <Icon name="reload" size={SIZE.md} color={colors.accent} />
+ <Paragraph
+ size={SIZE.xs + 1}
+ color={colors.icon}
+ style={{ marginLeft: 5 }}
+ >
+ {item.recurringMode.slice(0, 1).toUpperCase() +
+ item.recurringMode.slice(1) +
+ "ly"}
+ </Paragraph>
+ </View>
+ ) : null}
+ <View
+ style={{
+ backgroundColor: colors.nav,
+ borderRadius: 5,
+ flexDirection: "row",
+ paddingHorizontal: 5,
+ paddingVertical: 3,
+ alignItems: "center",
+ marginTop: 5,
+ justifyContent: "flex-start",
+ alignSelf: "flex-start"
+ }}
+ >
+ {item.date ? (
+ <>
+ <Icon
+ name="clock-outline"
+ size={SIZE.md}
+ color={colors.accent}
+ />
+ <Paragraph
+ size={SIZE.xs + 1}
+ color={colors.icon}
+ style={{ marginLeft: 5 }}
+ >
+ {formatReminderTime(item)}
+ </Paragraph>
+ </>
+ ) : null}
+ </View>
+ </View>
+ </View>
+ <IconButton
+ testID={notesnook.listitem.menu}
+ color={colors.pri}
+ name="dots-horizontal"
+ size={SIZE.xl}
+ onPress={() => Properties.present(item)}
+ customStyle={{
+ justifyContent: "center",
+ height: 35,
+ width: 35,
+ borderRadius: 100,
+ alignItems: "center"
+ }}
+ />
+ </SelectionWrapper>
+ );
},
(prev, next) => {
if (prev.item?.dateModified !== next.item?.dateModified) {
diff --git a/apps/mobile/app/components/properties/date-meta.js b/apps/mobile/app/components/properties/date-meta.js
index 5996a1a9b..b1b5e5124 100644
--- a/apps/mobile/app/components/properties/date-meta.js
+++ b/apps/mobile/app/components/properties/date-meta.js
@@ -44,7 +44,7 @@ export const DateMeta = ({ item }) => {
};
const renderItem = (key) =>
- key.startsWith("date") ? (
+ key.startsWith("date") && key !== "date" ? (
<View
key={key}
style={{
diff --git a/apps/mobile/app/components/properties/index.js b/apps/mobile/app/components/properties/index.js
index ca06199b9..2cff2f714 100644
--- a/apps/mobile/app/components/properties/index.js
+++ b/apps/mobile/app/components/properties/index.js
@@ -27,6 +27,7 @@ import SearchService from "../../services/search";
import { useThemeStore } from "../../stores/use-theme-store";
import { COLORS_NOTE } from "../../utils/color-scheme";
import { SIZE } from "../../utils/size";
+import { formatReminderTime } from "../../utils/time";
import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
import { ColorTags } from "./color-tags";
@@ -37,6 +38,7 @@ import Notebooks from "./notebooks";
import { Synced } from "./synced";
import { Tags } from "./tags";
import { Topics } from "./topics";
+import Icon from "react-native-vector-icons/MaterialCommunityIcons";
export const Properties = ({
close = () => {},
item,
@@ -98,7 +100,9 @@ export const Properties = ({
numberOfLines={2}
color={colors.icon}
>
- {(item.type === "notebook" || item.itemType === "notebook") &&
+ {(item.type === "notebook" ||
+ item.itemType === "notebook" ||
+ item.type === "reminder") &&
item?.description
? item.description
: null}
@@ -109,6 +113,39 @@ export const Properties = ({
</Paragraph>
) : null}
+ {item.type === "reminder" ? (
+ <View
+ style={{
+ backgroundColor: colors.nav,
+ borderRadius: 5,
+ flexDirection: "row",
+ paddingHorizontal: 5,
+ paddingVertical: 3,
+ alignItems: "center",
+ justifyContent: "flex-start",
+ alignSelf: "flex-start",
+ marginBottom: 5
+ }}
+ >
+ {item.date ? (
+ <>
+ <Icon
+ name="clock-outline"
+ size={SIZE.md}
+ color={colors.accent}
+ />
+ <Paragraph
+ size={SIZE.xs + 1}
+ color={colors.icon}
+ style={{ marginLeft: 5 }}
+ >
+ {formatReminderTime(item)}
+ </Paragraph>
+ </>
+ ) : null}
+ </View>
+ ) : null}
+
{item.type === "note" ? <Tags close={close} item={item} /> : null}
<Topics item={item} close={close} />
@@ -202,6 +239,11 @@ Properties.present = (item, buttons = []) => {
props[0] = db.tags.tag(item.id);
props.push(["Add Shortcut", "Delete", "Rename Tag"]);
break;
+ case "reminder": {
+ props[0] = db.reminders.reminder(item.id);
+ props.push(["Edit reminder", "Delete"]);
+ break;
+ }
}
if (!props[0]) return;
presentSheet({
diff --git a/apps/mobile/app/components/sheets/reminder/index.tsx b/apps/mobile/app/components/sheets/reminder/index.tsx
index 6d2cb1424..e8c835dc0 100644
--- a/apps/mobile/app/components/sheets/reminder/index.tsx
+++ b/apps/mobile/app/components/sheets/reminder/index.tsx
@@ -22,7 +22,8 @@ import ActionSheet from "react-native-actions-sheet";
import DateTimePickerModal from "react-native-modal-datetime-picker";
import {
presentSheet,
- PresentSheetOptions
+ PresentSheetOptions,
+ ToastEvent
} from "../../../services/event-manager";
import { useThemeStore } from "../../../stores/use-theme-store";
import { SIZE } from "../../../utils/size";
@@ -32,7 +33,10 @@ import Input from "../../ui/input";
import Notifications, { Reminder } from "../../../services/notifications";
import Paragraph from "../../ui/typography/paragraph";
import dayjs from "dayjs";
-
+import { db } from "../../../common/database";
+import Navigation from "../../../services/navigation";
+import { formatReminderTime } from "../../../utils/time";
+import Icon from "react-native-vector-icons/MaterialCommunityIcons";
type ReminderSheetProps = {
actionSheetRef: RefObject<ActionSheet>;
close?: () => void;
@@ -82,21 +86,29 @@ export default function ReminderSheet({
reminder
}: ReminderSheetProps) {
const colors = useThemeStore((state) => state.colors);
- const [reminderMode, setReminderMode] = useState<string | undefined>(
- ReminderModes.Once
+ const [reminderMode, setReminderMode] = useState<Reminder["mode"]>(
+ reminder?.mode || "once"
+ );
+ const [recurringMode, setRecurringMode] = useState<Reminder["recurringMode"]>(
+ reminder?.recurringMode || "week"
+ );
+ const [selectedDays, setSelectedDays] = useState<number[]>(
+ reminder?.selectedDays || []
);
- const [recurringMode, setRecurringMode] = useState(RecurringModes.Week);
- const [selectedDays, setSelectedDays] = useState<number[]>([]);
- const [date, setDate] = useState<Date>(new Date(Date.now()));
- const [time, setTime] = useState<string>(dayjs(Date.now()).format("HH:mm"));
- const [reminderNotificationMode, setReminderNotificatioMode] = useState(
- ReminderNotificationModes.Silent
+ const [date, setDate] = useState<Date>(
+ new Date(reminder?.date || Date.now())
);
+ const [time, setTime] = useState<string>(
+ dayjs(reminder?.date || Date.now()).format("hh:mm a")
+ );
+ const [reminderNotificationMode, setReminderNotificatioMode] = useState<
+ Reminder["priority"]
+ >(reminder?.priority || "silent");
const [isDatePickerVisible, setDatePickerVisibility] = useState(false);
const [isTimePickerVisible, setTimePickerVisibility] = useState(false);
const [repeatFrequency, setRepeatFrequency] = useState(1);
- const title = useRef<string>();
- const details = useRef<string>();
+ const title = useRef<string | undefined>(reminder?.title);
+ const details = useRef<string | undefined>(reminder?.description);
const showDatePicker = () => {
setDatePickerVisibility(true);
@@ -112,7 +124,7 @@ export default function ReminderSheet({
};
const handleConfirm = (date: Date) => {
- setTime(dayjs(date).format("HH:mm"));
+ setTime(dayjs(date).format("hh:mm a"));
setDate(date);
hideDatePicker();
};
@@ -138,6 +150,34 @@ export default function ReminderSheet({
return text;
}
+ async function saveReminder() {
+ if (!(await Notifications.checkAndRequestPermissions())) return;
+ if ((!date && reminderMode !== ReminderModes.Permanent) || !title.current)
+ return;
+ const reminderId = await db.reminders?.add({
+ id: reminder?.id,
+ date: date?.getTime(),
+ dateCreated: Date.now(),
+ dateModified: Date.now(),
+ priority: reminderNotificationMode,
+ title: title.current,
+ description: details.current,
+ recurringMode: recurringMode,
+ selectedDays: selectedDays,
+ mode: reminderMode
+ });
+
+ const _reminder = db.reminders?.reminder(reminderId);
+
+ if (!_reminder) {
+ ToastEvent.show({
+ heading: "Failed to add a new reminder"
+ });
+ }
+ Notifications.scheduleNotification(_reminder as Reminder);
+ Navigation.queueRoutesForUpdate("Reminders");
+ }
+
return (
<View
style={{
@@ -152,7 +192,7 @@ export default function ReminderSheet({
/>
<Input
- defaultValue={reminder?.details}
+ defaultValue={reminder?.description}
placeholder="Add a quick note"
onChangeText={(text) => (details.current = text)}
containerStyle={{ borderWidth: 0, borderBottomWidth: 1 }}
@@ -181,7 +221,9 @@ export default function ReminderSheet({
}
onPress={() => {
setReminderMode(
- ReminderModes[mode as keyof typeof ReminderModes]
+ ReminderModes[
+ mode as keyof typeof ReminderModes
+ ] as Reminder["mode"]
);
}}
/>
@@ -204,7 +246,6 @@ export default function ReminderSheet({
alignItems: "center"
}}
>
- <Paragraph style={{ marginRight: 5 }}>Every</Paragraph>
{/* {Platform.OS === "android" ? (
<Input
containerStyle={{
@@ -249,7 +290,9 @@ export default function ReminderSheet({
}
onPress={() => {
setRecurringMode(
- RecurringModes[mode as keyof typeof RecurringModes]
+ RecurringModes[
+ mode as keyof typeof RecurringModes
+ ] as Reminder["recurringMode"]
);
setSelectedDays([]);
setRepeatFrequency(1);
@@ -410,7 +453,7 @@ export default function ReminderSheet({
setReminderNotificatioMode(
ReminderNotificationModes[
mode as keyof typeof ReminderNotificationModes
- ]
+ ] as Reminder["priority"]
);
}}
/>
@@ -418,24 +461,30 @@ export default function ReminderSheet({
</View>
)}
- <Paragraph
- color={colors.icon}
- size={SIZE.xs}
- style={{ marginTop: 5, marginBottom: 12 }}
- >
- {reminderMode === ReminderModes.Once ||
- reminderMode === ReminderModes.Permanent
- ? undefined
- : selectedDays.length === 7 && recurringMode === RecurringModes.Week
- ? `The reminder will repeat daily at ${dayjs(date).format("HH:mm")}.`
- : selectedDays.length === 0
- ? recurringMode === RecurringModes.Week
- ? "Select day of the week to repeat the reminder."
- : "Select nth day of the month to repeat the reminder."
- : `Repeats every${repeatFrequency > 1 ? " " + repeatFrequency : ""} ${
- repeatFrequency > 1 ? recurringMode + "s" : recurringMode
- } on ${getSelectedDaysText(selectedDays)}.`}
- </Paragraph>
+ {reminderMode === ReminderModes.Once ||
+ reminderMode === ReminderModes.Permanent ? null : (
+ <Paragraph
+ color={colors.icon}
+ size={SIZE.xs}
+ style={{ marginTop: 5, marginBottom: 12 }}
+ >
+ {selectedDays.length === 7 && recurringMode === RecurringModes.Week
+ ? `The reminder will repeat daily at ${dayjs(date).format(
+ "hh:mm A"
+ )}.`
+ : selectedDays.length === 0
+ ? recurringMode === RecurringModes.Week
+ ? "Select day of the week to repeat the reminder."
+ : "Select nth day of the month to repeat the reminder."
+ : `Repeats every${
+ repeatFrequency > 1 ? " " + repeatFrequency : ""
+ } ${
+ repeatFrequency > 1 ? recurringMode + "s" : recurringMode
+ } on ${getSelectedDaysText(selectedDays)} at ${dayjs(date).format(
+ "hh:mm A"
+ )}.`}
+ </Paragraph>
+ )}
<Button
style={{
@@ -443,33 +492,40 @@ export default function ReminderSheet({
}}
title="Save"
type="accent"
- onPress={async () => {
- if (!(await Notifications.checkAndRequestPermissions())) return;
- if (
- (!date && reminderMode !== ReminderModes.Permanent) ||
- !title.current
- )
- return;
- Notifications.scheduleNotification({
- id: "test_1",
- type: "reminder",
- date: date?.getTime(),
- dateCreated: Date.now(),
- dateModified: Date.now(),
- priority: reminderNotificationMode as any,
- title: title.current,
- details: details.current,
- recurringMode: recurringMode as any,
- selectedDays: selectedDays,
- mode: reminderMode as any
- });
- }}
+ onPress={saveReminder}
/>
+
+ {reminder && reminder.date ? (
+ <View
+ style={{
+ backgroundColor: colors.nav,
+ borderRadius: 5,
+ flexDirection: "row",
+ paddingHorizontal: 5,
+ paddingVertical: 3,
+ alignItems: "center",
+ justifyContent: "flex-start",
+ alignSelf: "center",
+ marginTop: 12
+ }}
+ >
+ <>
+ <Icon name="clock-outline" size={SIZE.md} color={colors.accent} />
+ <Paragraph
+ size={SIZE.xs + 1}
+ color={colors.icon}
+ style={{ marginLeft: 5 }}
+ >
+ Upcoming: {formatReminderTime(reminder)}
+ </Paragraph>
+ </>
+ </View>
+ ) : null}
</View>
);
}
-ReminderSheet.present = (reminder: Reminder) => {
+ReminderSheet.present = (reminder?: Reminder) => {
presentSheet({
component: (ref, close, update) => (
<ReminderSheet
diff --git a/apps/mobile/app/components/sheets/sort/index.js b/apps/mobile/app/components/sheets/sort/index.js
index 28b944728..450adead0 100644
--- a/apps/mobile/app/components/sheets/sort/index.js
+++ b/apps/mobile/app/components/sheets/sort/index.js
@@ -141,8 +141,8 @@ const Sort = ({ type, screen }) => {
) : (
Object.keys(SORT).map((item) =>
(item === "title" && groupOptions.groupBy !== "none") ||
- (screen !== "Tags" && item === "dateModified") ||
- (screen === "Tags" && item === "dateEdited") ? null : (
+ (screen !== "Tags" || screen !== "Reminders" && item === "dateModified") ||
+ (screen === "Tags" || screen === "Reminders" && item === "dateEdited") ? null : (
<Button
key={item}
type={groupOptions.sortBy === item ? "grayBg" : "gray"}
diff --git a/apps/mobile/app/hooks/use-actions.js b/apps/mobile/app/hooks/use-actions.js
index 045333a35..ba13d4209 100644
--- a/apps/mobile/app/hooks/use-actions.js
+++ b/apps/mobile/app/hooks/use-actions.js
@@ -27,6 +27,7 @@ import { presentDialog } from "../components/dialog/functions";
import NoteHistory from "../components/note-history";
import ExportNotesSheet from "../components/sheets/export-notes";
import { MoveNotes } from "../components/sheets/move-notes/movenote";
+import ReminderSheet from "../components/sheets/reminder";
import {
eSendEvent,
eSubscribeEvent,
@@ -49,7 +50,8 @@ import { toggleDarkMode } from "../utils/color-scheme/utils";
import {
eOpenAddNotebookDialog,
eOpenAddTopicDialog,
- eOpenAttachmentsDialog, eOpenLoginDialog,
+ eOpenAttachmentsDialog,
+ eOpenLoginDialog,
eOpenMoveNoteDialog,
eOpenPublishNoteDialog
} from "../utils/events";
@@ -435,28 +437,39 @@ export const useActions = ({ close = () => null, item }) => {
async function deleteItem() {
if (!checkNoteSynced()) return;
close();
- if (item.type === "tag") {
+ if (item.type === "tag" || item.type === "reminder") {
await sleep(300);
presentDialog({
- title: "Delete tag",
- paragraph: "This tag will be removed from all notes.",
+ title: `Delete ${item.type}`,
+ paragraph:
+ item.type === "reminder"
+ ? "This reminder will be removed"
+ : "This tag will be removed from all notes.",
positivePress: async () => {
- await db.tags.remove(item.id);
- useTagStore.getState().setTags();
- Navigation.queueRoutesForUpdate(
- "TaggedNotes",
- "ColoredNotes",
- "TopicNotes",
- "Favorites",
- "Notes",
- "Tags"
- );
+ const routes = [];
+ if (item.type === "reminder") {
+ await db.reminders.remove(item.id);
+ routes.push("Reminders");
+ } else {
+ await db.tags.remove(item.id);
+ useTagStore.getState().setTags();
+ routes.push(
+ "TaggedNotes",
+ "ColoredNotes",
+ "TopicNotes",
+ "Favorites",
+ "Notes",
+ "Tags"
+ );
+ }
+ Navigation.queueRoutesForUpdate(...routes);
},
positiveText: "Delete",
positiveType: "errorShade"
});
return;
}
+
if (item.locked) {
await sleep(300);
openVault({
@@ -781,6 +794,17 @@ export const useActions = ({ close = () => null, item }) => {
close: false,
nopremium: true,
id: notesnook.ids.dialogs.actionsheet.night
+ },
+ {
+ name: "Edit reminder",
+ title: "Edit reminder",
+ icon: "clock-outline",
+ func: async () => {
+ close();
+ await sleep(300);
+ ReminderSheet.present(item);
+ },
+ close: false
}
];
diff --git a/apps/mobile/app/screens/home/index.tsx b/apps/mobile/app/screens/home/index.tsx
index b5bc82184..61737fb35 100755
--- a/apps/mobile/app/screens/home/index.tsx
+++ b/apps/mobile/app/screens/home/index.tsx
@@ -22,7 +22,6 @@ import { db } from "../../common/database";
import { FloatingButton } from "../../components/container/floating-button";
import DelayLayout from "../../components/delay-layout";
import List from "../../components/list";
-import ReminderSheet from "../../components/sheets/reminder";
import { useNavigationFocus } from "../../hooks/use-navigation-focus";
import Navigation, { NavigationProps } from "../../services/navigation";
import SearchService from "../../services/search";
@@ -80,9 +79,7 @@ export const Home = ({ navigation, route }: NavigationProps<"Notes">) => {
placeholderData={PLACEHOLDER_DATA}
/>
- <FloatingButton title="Create a new note" onPress={() => {
- ReminderSheet.present();
- }} />
+ <FloatingButton title="Create a new note" onPress={openEditor} />
</DelayLayout>
);
};
diff --git a/apps/mobile/app/screens/reminders/index.tsx b/apps/mobile/app/screens/reminders/index.tsx
index 45235ef70..7695c52cb 100644
--- a/apps/mobile/app/screens/reminders/index.tsx
+++ b/apps/mobile/app/screens/reminders/index.tsx
@@ -19,8 +19,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import React from "react";
import { db } from "../../common/database";
+import { FloatingButton } from "../../components/container/floating-button";
import DelayLayout from "../../components/delay-layout";
import List from "../../components/list";
+import ReminderSheet from "../../components/sheets/reminder";
import { useNavigationFocus } from "../../hooks/use-navigation-focus";
import Navigation, { NavigationProps } from "../../services/navigation";
import SearchService from "../../services/search";
@@ -40,7 +42,10 @@ const prepareSearch = () => {
const PLACEHOLDER_DATA = {
heading: "Your reminders",
paragraph: "You have not set any reminders yet.",
- button: null,
+ button: "Set a new reminder",
+ action: () => {
+ ReminderSheet.present();
+ },
loading: "Loading reminders"
};
@@ -78,6 +83,13 @@ export const Reminders = ({
screen="Reminders"
placeholderData={PLACEHOLDER_DATA}
/>
+
+ <FloatingButton
+ title="Set a new reminder"
+ onPress={() => {
+ ReminderSheet.present();
+ }}
+ />
</DelayLayout>
);
};
diff --git a/apps/mobile/app/stores/index.ts b/apps/mobile/app/stores/index.ts
index eac9f2d37..cab851356 100644
--- a/apps/mobile/app/stores/index.ts
+++ b/apps/mobile/app/stores/index.ts
@@ -26,7 +26,7 @@ import { useNotebookStore } from "./use-notebook-store";
import { useNoteStore } from "./use-notes-store";
import { useTagStore } from "./use-tag-store";
import { useTrashStore } from "./use-trash-store";
-
+import { useReminderStore } from "./use-reminder-store";
export function initAfterSync() {
useMenuStore.getState().setColorNotes();
useMenuStore.getState().setMenuPins();
@@ -45,6 +45,7 @@ export function initialize() {
useTagStore.getState().setTags();
useFavoriteStore.getState().setFavorites();
useNoteStore.getState().setNotes();
+ useReminderStore.getState().setReminders();
});
}
@@ -56,4 +57,5 @@ export function clearAllStores() {
useNoteStore.getState().clearNotes();
useMenuStore.getState().clearAll();
useTrashStore.getState().clearTrash();
+ useReminderStore.getState().cleareReminders();
}
diff --git a/apps/mobile/app/utils/constants.js b/apps/mobile/app/utils/constants.js
index 530f7b890..ab76ea724 100644
--- a/apps/mobile/app/utils/constants.js
+++ b/apps/mobile/app/utils/constants.js
@@ -97,6 +97,16 @@ export const SUBSCRIPTION_PROVIDER = {
}
};
+export const WeekDayNames = {
+ 0: "Sunday",
+ 1: "Monday",
+ 2: "Tuesday",
+ 3: "Wednesday",
+ 4: "Thursday",
+ 5: "Friday",
+ 6: "Saturday"
+};
+
export const MenuItemsList = [
{
name: "Notes",
diff --git a/apps/mobile/app/utils/index.js b/apps/mobile/app/utils/index.js
index 3805b1462..7762d1833 100755
--- a/apps/mobile/app/utils/index.js
+++ b/apps/mobile/app/utils/index.js
@@ -122,6 +122,13 @@ export async function doInBackground(cb) {
}
}
+export function nth(n) {
+ return (
+ ["st", "nd", "rd"][(((((n < 0 ? -n : n) + 90) % 100) - 10) % 10) - 1] ||
+ "th"
+ );
+}
+
export function setWidthHeight(size) {
dWidth = size.width;
dHeight = size.height;