mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-07-09 20:09:36 +02:00
mobile: remove today/tomorrow logic and set default expiry initial date to 1 week
Signed-off-by: kashaf-ansari-dev <kashafansari3108@gmail.com>
This commit is contained in:
committed by
Ammar Ahmed
parent
19a11dae26
commit
3db6c2b1fd
@@ -32,7 +32,7 @@ export default function DatePickerComponent(props: {
|
||||
onCancel: () => void;
|
||||
}) {
|
||||
const { colors, isDark } = useThemeColors();
|
||||
const dateRef = useRef<Date>(dayjs().add(1, "day").toDate());
|
||||
const dateRef = useRef<Date>(dayjs().add(1, "week").toDate());
|
||||
|
||||
const { width } = useWindowDimensions();
|
||||
|
||||
|
||||
@@ -42,22 +42,10 @@ export const ExpiryDate = ({
|
||||
short?: boolean;
|
||||
} & ButtonProps) => {
|
||||
const { colors } = useThemeColors();
|
||||
|
||||
const expiryValue = note?.expiryDate?.value;
|
||||
if (!expiryValue) return null;
|
||||
|
||||
const expiryDate = dayjs(expiryValue);
|
||||
const now = dayjs();
|
||||
const isToday = expiryDate.isSame(now, "day");
|
||||
const isTomorrow = expiryDate.isSame(now.add(1, "day"), "day");
|
||||
|
||||
const formattedDate = isToday
|
||||
? "Today"
|
||||
: isTomorrow
|
||||
? "Tomorrow"
|
||||
: expiryDate.format("DD MMM YYYY");
|
||||
|
||||
const isUrgent = isToday || isTomorrow;
|
||||
const formattedDate = dayjs(expiryValue).format("DD MMM YYYY");
|
||||
|
||||
return (
|
||||
<Button
|
||||
@@ -66,9 +54,6 @@ export const ExpiryDate = ({
|
||||
fontSize={textStyle?.fontSize || AppFontSize.xs}
|
||||
iconSize={iconSize || AppFontSize.sm}
|
||||
type="secondary"
|
||||
buttonType={
|
||||
isUrgent ? { text: color || colors.primary.accent } : undefined
|
||||
}
|
||||
textStyle={{
|
||||
marginRight: 0,
|
||||
...textStyle
|
||||
|
||||
Reference in New Issue
Block a user