Skip to content

Commit

Permalink
Incorrect conversion from ISO date (#803)
Browse files Browse the repository at this point in the history
* chore(landing): set new landing page

* chore(landing): change site on dev mode

* fix(frontend): take iso into account for converting to day

* fix(frontend): remove max date restriction

* build(backend): bump version

* Revert "fix(frontend): remove max date restriction"

This reverts commit c9c6422.
  • Loading branch information
IgnisDa committed May 1, 2024
1 parent 6ac72cc commit aa46e80
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ryot"
version = "5.0.10"
version = "5.0.11"
edition = "2021"
repository = "https://github.com/IgnisDa/ryot"
license = "GPL-3.0"
Expand Down
5 changes: 2 additions & 3 deletions apps/landing/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import sitemap from "@astrojs/sitemap";
import tailwind from "@astrojs/tailwind";
import { defineConfig } from "astro/config";

import robotsTxt from "astro-robots-txt";

// https://astro.build/config
export default defineConfig({
site: import.meta.env.DEV
? "http://localhost:3000"
: "https://luna-landing-rust.vercel.app/",
? "http://localhost:4200"
: "https://ryot.pages.dev/",
integrations: [tailwind(), sitemap(), robotsTxt()],
});
2 changes: 1 addition & 1 deletion apps/landing/src/data/landing.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@type": "Organization",
"name": "Ryot",
"description": "A self hosted platform for tracking various facets of your life - media, fitness and much more!",
"url": "https://luna-landing-rust.vercel.app/",
"url": "https://ryot.pages.dev/",
"logo": "https://raw.githubusercontent.com/IgnisDa/ryot/main/libs/assets/favicon-32x32.png",
"contactPoint": {
"@type": "ContactPoint",
Expand Down
4 changes: 2 additions & 2 deletions apps/landing/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Meta } from "@/config/landing.interface";
import "@fontsource-variable/rubik";
interface Props {
meta: Meta;
meta: Meta;
}
const { meta } = Astro.props;
Expand All @@ -22,7 +22,7 @@ const ldJson = JSON.stringify(meta.ldJson);
<title>{meta.title}</title>
<meta name="description" content={meta.description} />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" type="image/svg+xml" href={meta.ldJson.logo} />
<link rel="canonical" href={import.meta.env.SITE} />
<script type="application/ld+json" set:html={ldJson} is:inline />
</head>
Expand Down
1 change: 1 addition & 0 deletions libs/ts-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@ryot/ts-utils",
"dependencies": {
"@ryot/generated": "workspace:*",
"dayjs": "1.11.10",
"humanize-duration-ts": "2.1.1",
"lodash": "4.17.21"
},
Expand Down
3 changes: 2 additions & 1 deletion libs/ts-utils/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { UserUnitSystem } from "@ryot/generated/graphql/backend/graphql";
import dayjs from "dayjs";
import {
HumanizeDuration,
HumanizeDurationLanguage,
Expand Down Expand Up @@ -56,7 +57,7 @@ export const displayDistanceWithUnit = (
* Format a `Date` into a Rust `NaiveDate`
*/
export const formatDateToNaiveDate = (t: Date) => {
return t.toISOString().split("T")[0];
return dayjs(t).format("YYYY-MM-DD");
};

/**
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4131,6 +4131,7 @@ __metadata:
dependencies:
"@ryot/generated": "workspace:*"
"@types/lodash": "npm:^4.17.0"
dayjs: "npm:1.11.10"
humanize-duration-ts: "npm:2.1.1"
lodash: "npm:4.17.21"
languageName: unknown
Expand Down

0 comments on commit aa46e80

Please sign in to comment.