diff --git a/app/api/utils.ts b/app/api/utils.ts
index da7c6fa..53b48ae 100644
--- a/app/api/utils.ts
+++ b/app/api/utils.ts
@@ -144,15 +144,6 @@ export function unixToDate(
);
}
-export const getSeasonFromUnix = (unix: number) => {
- const date = new Date(unix * 1000);
- const month = date.getMonth();
- if (month >= 3 && month <= 5) return "весна";
- if (month >= 6 && month <= 8) return "лето";
- if (month >= 9 && month <= 11) return "осень";
- return "зима";
-};
-
export function sinceUnixDate(unixInSeconds: number) {
const unix = Math.floor(unixInSeconds * 1000);
const date = new Date(unix);
diff --git a/app/components/ReleaseInfo/ReleaseInfo.Info.tsx b/app/components/ReleaseInfo/ReleaseInfo.Info.tsx
index 4f9e666..ab58da7 100644
--- a/app/components/ReleaseInfo/ReleaseInfo.Info.tsx
+++ b/app/components/ReleaseInfo/ReleaseInfo.Info.tsx
@@ -1,6 +1,6 @@
import { Card, Table } from "flowbite-react";
import { ReleaseInfoSearchLink } from "#/components/ReleaseInfo/ReleaseInfo.SearchLink";
-import { unixToDate, getSeasonFromUnix, minutesToTime } from "#/api/utils";
+import { unixToDate, minutesToTime } from "#/api/utils";
const weekDay = [
"_",
"каждый понедельник",
@@ -33,21 +33,20 @@ export const ReleaseInfoInfo = (props: {
- {props.country ? (
- props.country.toLowerCase() == "япония" ? (
+ {props.country ?
+ props.country.toLowerCase() == "япония" ?
- ) : (
-
- )
- ) : (
-
- )}
+ :
+
+ :
+ }
{props.country && props.country}
{(props.aired_on_date != 0 || props.year) && ", "}
- {props.aired_on_date != 0 &&
- `${getSeasonFromUnix(props.aired_on_date)} `}
+ {props.season && props.season != 0 ?
+ `${YearSeason[props.season]} `
+ : ""}
{props.year && `${props.year} г.`}
@@ -59,7 +58,8 @@ export const ReleaseInfoInfo = (props: {
{props.episodes.released ? props.episodes.released : "?"}
{"/"}
{props.episodes.total ? props.episodes.total + " эп. " : "? эп. "}
- {props.duration != 0 && `по ${minutesToTime(props.duration, "daysHours")}`}
+ {props.duration != 0 &&
+ `по ${minutesToTime(props.duration, "daysHours")}`}
@@ -69,9 +69,9 @@ export const ReleaseInfoInfo = (props: {
{props.category}
{", "}
- {props.broadcast == 0
- ? props.status.toLowerCase()
- : `выходит ${weekDay[props.broadcast]}`}
+ {props.broadcast == 0 ?
+ props.status.toLowerCase()
+ : `выходит ${weekDay[props.broadcast]}`}
@@ -88,7 +88,10 @@ export const ReleaseInfoInfo = (props: {
return (
{index > 0 && ", "}
-
+
);
})}
@@ -98,14 +101,20 @@ export const ReleaseInfoInfo = (props: {
{props.author && (
<>
{"Автор: "}
-
+
{props.director && ", "}
>
)}
{props.director && (
<>
{"Режиссёр: "}
-
+
>
)}
@@ -132,18 +141,16 @@ export const ReleaseInfoInfo = (props: {
- {props.aired_on_date != 0 ? (
+ {props.aired_on_date != 0 ?
unixToDate(props.aired_on_date, "full")
- ) : props.year ? (
+ : props.year ?
<>
- {props.season && props.season != 0
- ? `${YearSeason[props.season]} `
- : ""}
+ {props.season && props.season != 0 ?
+ `${YearSeason[props.season]} `
+ : ""}
{props.year && `${props.year} г.`}
>
- ) : (
- "Скоро"
- )}
+ : "Скоро"}
)}