Skip to content

Commit

Permalink
fix: Dates on Safari browser
Browse files Browse the repository at this point in the history
  • Loading branch information
moerabaya committed Apr 5, 2024
1 parent 045c4f1 commit ac02459
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 23 deletions.
8 changes: 1 addition & 7 deletions components/organisms/Navigation/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
import Logo from "assets/images/logo.svg";
import { AnimatedView } from "components/atoms";
import consts from "consts";
import useGlobalization from "hooks/useGlobalization";
import Link from "next/link";
import { useRouter } from "next/router";
import React, { useContext, useState } from "react";
import { BsGithub, BsLinkedin } from "react-icons/bs";
import { ThemeContext } from "templates/ThemeProvider";
import { Project } from "types";
import Cookies from "universal-cookie";
import navigation from "utils/data/navigation.json";
import { Burger } from "../../atoms/Button";
import Nav from "./Nav.styled";
import * as fs from "fs/promises";
import path from "path";
import grayMatter from "gray-matter";

const Pages = navigation;

Expand Down Expand Up @@ -48,7 +42,7 @@ const Navigation = ({ hasReadPermission, previous, next }: any) => {
>
<span
className={`bg-[#EAEAEA] dark:bg-neutral-900 border-stone-200 border-[1px] border-solid dark:border-neutral-800 w-9 h-9 inline-block rounded-full transition-transform ${
isDark && "translate-x-[94%]"
isDark && "translate-x-[94%] rtl:-translate-x-[94%]"
}`}
></span>
<div
Expand Down
10 changes: 5 additions & 5 deletions pages/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const jobs = (globalization: Globalization) => {
};
return [
{
date: `${new Date("01-01-2023").toLocaleDateString(
date: `${new Date(2023, 1, 1).toLocaleDateString(
dateLocale,
options
)} - ${translate("about.experience.present", "Present")}`,
Expand All @@ -53,10 +53,10 @@ const jobs = (globalization: Globalization) => {
role: translate("about.experience.fullTime", "Full-time"),
},
{
date: `${new Date("11-01-2017").toLocaleDateString(
date: `${new Date(2017, 11, 1).toLocaleDateString(
dateLocale,
options
)} - ${new Date("12-31-2022").toLocaleDateString(dateLocale, options)}`,
)} - ${new Date(2022, 12, 31).toLocaleDateString(dateLocale, options)}`,
title: translate(
"about.experience.seniorFrontendEngineer",
"Senior Front-end Engineer"
Expand All @@ -66,10 +66,10 @@ const jobs = (globalization: Globalization) => {
role: translate("about.experience.fullTime", "Full-time"),
},
{
date: `${new Date("06-01-2015").toLocaleDateString(
date: `${new Date(2015, 6, 1).toLocaleDateString(
dateLocale,
options
)} - ${new Date("11-01-2017").toLocaleDateString(dateLocale, options)}`,
)} - ${new Date(2017, 11, 1).toLocaleDateString(dateLocale, options)}`,
title: translate(
"about.experience.frontendEngineer",
"Front-end Engineer"
Expand Down
5 changes: 1 addition & 4 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ import Head from "next/head";
import Image from "next/image";
import Link from "next/link";
import path from "path";
import { useState } from "react";
import AnimatedView from "../components/atoms/AnimatedView";
import { Project } from "../types";

interface Props {
projects: Project[];
}
const Home: NextPage<Props> = ({ projects }: Props) => {
const [headerAnimateState, setHeaderAniamteState] = useState(false);
const { getLocalizedString } = useGlobalization();

function WorkItems() {
Expand Down Expand Up @@ -140,13 +138,12 @@ const Home: NextPage<Props> = ({ projects }: Props) => {
<AnimatedText
text={getLocalizedString("home", "title")}
type="h2"
finished={(state: boolean) => setHeaderAniamteState(state)}
className="m-0 max-sm:text-2xl"
/>
</div>
<div className="container max-w-5xl mx-auto px-5">{WorkItems()}</div>
<div className="py-20 bg-stone-100 dark:bg-neutral-950 px-5 max-md:py-12">
<div className="container mx-auto max-w-2xl flex items-center justify-between max-sm:flex-col max-sm:w-full max-sm:w-full">
<div className="container mx-auto max-w-2xl flex items-center justify-between max-sm:flex-col max-sm:w-full">
<h2 className="font-medium text-stone-800 dark:text-neutral-50 max-md:text-2xl">
{getLocalizedString("home", "contact-title")}
</h2>
Expand Down
8 changes: 1 addition & 7 deletions templates/ThemeProvider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import React, {
createContext,
Dispatch,
SetStateAction,
useEffect,
useState,
} from "react";
import React, { createContext, useEffect, useState } from "react";

type Theme = "light" | "dark";

Expand Down

0 comments on commit ac02459

Please sign in to comment.