Skip to content

Commit

Permalink
🚑 月が一桁になったことで挙動がおかしくなっていた箇所を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
yamaji committed Jan 15, 2025
1 parent 9240256 commit d46c2c5
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default async function Home() {
month={date.getMonth() + 1}
></MonthlyDetectedPersonGraph>
<Link
href={`/fukui-station-east-entrance/monthly/${date.getFullYear()}/${date.getMonth() + 1}`}
href={`/fukui-station-east-entrance/monthly/${date.getFullYear()}/${(date.getMonth() + 1).toString().padStart(2, "0")}`}
className="mt-4 flex items-center underline hover:font-bold hover:text-primary"
>
福井駅のデータを詳しく見る
Expand All @@ -31,7 +31,7 @@ export default async function Home() {
month={date.getMonth() + 1}
></MonthlyDetectedPersonGraph>
<Link
href={`/tojinbo-shotaro/monthly/${date.getFullYear()}/${date.getMonth() + 1}`}
href={`/tojinbo-shotaro/monthly/${date.getFullYear()}/${(date.getMonth() + 1).toString().padStart(2, "0")}`}
className="mt-4 flex items-center underline hover:font-bold hover:text-primary"
>
東尋坊のデータを詳しく見る
Expand All @@ -46,14 +46,14 @@ export default async function Home() {
month={date.getMonth() + 1}
></MonthlyEstimatedPrefectureGraph>
<Link
href={`/rainbow-line-parking-lot-1-gate/monthly/${date.getFullYear()}/${date.getMonth() + 1}`}
href={`/rainbow-line-parking-lot-1-gate/monthly/${date.getFullYear()}/${(date.getMonth() + 1).toString().padStart(2, "0")}`}
className="mt-4 flex items-center underline hover:font-bold hover:text-primary"
>
レインボーライン第一駐車場のデータを詳しく見る
<ChevronRightIcon size={"medium"} />
</Link>
<Link
href={`/rainbow-line-parking-lot-2-gate/monthly/${date.getFullYear()}/${date.getMonth() + 1}`}
href={`/rainbow-line-parking-lot-2-gate/monthly/${date.getFullYear()}/${(date.getMonth() + 1).toString().padStart(2, "0")}`}
className="mt-4 flex items-center underline hover:font-bold hover:text-primary"
>
レインボーライン第二駐車場のデータを詳しく見る
Expand Down
2 changes: 1 addition & 1 deletion components/graphs/monthly-detected-person.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function MonthlyDetectedPersonGraph(props: {
month: number;
}) {
const csvStr = readFileSync(
`${process.cwd()}/data/people-flow-data/monthly/${props.placement}/Person/${props.year}/${props.year}-${props.month}.csv`,
`${process.cwd()}/data/people-flow-data/monthly/${props.placement}/Person/${props.year}/${props.year}-${props.month.toString().padStart(2, "0")}.csv`,
).toString();
const data = Papa.parse<AggregatedData>(csvStr, { header: true }).data.slice(0, -1);
// console.log(data);
Expand Down
2 changes: 1 addition & 1 deletion components/graphs/monthly-estimated-age.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function MonthlyEstimatedAgeGraph(props: {
month: number;
}) {
const csvStr = readFileSync(
`${process.cwd()}/data/people-flow-data/monthly/${props.placement}/Face/${props.year}/${props.year}-${props.month}.csv`,
`${process.cwd()}/data/people-flow-data/monthly/${props.placement}/Face/${props.year}/${props.year}-${props.month.toString().padStart(2, "0")}.csv`,
).toString();
const data = Papa.parse<AggregatedData>(csvStr, { header: true }).data.slice(0, -1);
// console.log(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function MonthlyEstimatedCarCategorySummaryGraph(props: {
month: number;
}) {
const csvStr = readFileSync(
`${process.cwd()}/data/people-flow-data/monthly/${props.placement}/LicensePlate/${props.year}/${props.year}-${props.month}.csv`,
`${process.cwd()}/data/people-flow-data/monthly/${props.placement}/LicensePlate/${props.year}/${props.year}-${props.month.toString().padStart(2, "0")}.csv`,
).toString();
const data = Papa.parse<AggregatedData>(csvStr, { header: true }).data.slice(0, -1);
// console.log(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function MonthlyEstimatedCarCategoryGraph(props: {
month: number;
}) {
const csvStr = readFileSync(
`${process.cwd()}/data/people-flow-data/monthly/${props.placement}/LicensePlate/${props.year}/${props.year}-${props.month}.csv`,
`${process.cwd()}/data/people-flow-data/monthly/${props.placement}/LicensePlate/${props.year}/${props.year}-${props.month.toString().padStart(2, "0")}.csv`,
).toString();
const data = Papa.parse<AggregatedData>(csvStr, { header: true }).data.slice(0, -1);
// console.log(data);
Expand Down
2 changes: 1 addition & 1 deletion components/graphs/monthly-estimated-gender.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function MonthlyEstimatedGenderGraph(props: {
month: number;
}) {
const csvStr = readFileSync(
`${process.cwd()}/data/people-flow-data/monthly/${props.placement}/Face/${props.year}/${props.year}-${props.month}.csv`,
`${process.cwd()}/data/people-flow-data/monthly/${props.placement}/Face/${props.year}/${props.year}-${props.month.toString().padStart(2, "0")}.csv`,
).toString();
const data = Papa.parse<AggregatedData>(csvStr, { header: true }).data.slice(0, -1);
// console.log(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function MonthlyEstimatedPrefectureSummaryGraph(props: {
month: number;
}) {
const csvStr = readFileSync(
`${process.cwd()}/data/people-flow-data/monthly/${props.placement}/LicensePlate/${props.year}/${props.year}-${props.month}.csv`,
`${process.cwd()}/data/people-flow-data/monthly/${props.placement}/LicensePlate/${props.year}/${props.year}-${props.month.toString().padStart(2, "0")}.csv`,
).toString();
const data = Papa.parse<AggregatedData>(csvStr, { header: true }).data.slice(0, -1);
// console.log(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function MonthlyEstimatedPrefectureGraph(props: {
month: number;
}) {
const csvStr = readFileSync(
`${process.cwd()}/data/people-flow-data/monthly/${props.placement}/LicensePlate/${props.year}/${props.year}-${props.month}.csv`,
`${process.cwd()}/data/people-flow-data/monthly/${props.placement}/LicensePlate/${props.year}/${props.year}-${props.month.toString().padStart(2, "0")}.csv`,
).toString();
const data = Papa.parse<AggregatedData>(csvStr, { header: true }).data.slice(0, -1);
// console.log(data);
Expand Down
4 changes: 2 additions & 2 deletions components/monthly-page-navigation.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function MonthlyPageNavigation(props: {
{prevAvailable ? (
<Link
className="group flex w-40 flex-shrink-[1] items-center justify-start text-primary underline transition-all hover:font-bold"
href={`/${props.placement}/monthly/${prevDate.getFullYear()}/${prevDate.getMonth() + 1}`}
href={`/${props.placement}/monthly/${prevDate.getFullYear()}/${(prevDate.getMonth() + 1).toString().padStart(2, "0")}`}
>
<ChevronLeftIcon size={"medium"} className="group-hover:scale-110" />
{`${prevDate.getFullYear()}${prevDate.getMonth() + 1}月`}
Expand All @@ -57,7 +57,7 @@ export async function MonthlyPageNavigation(props: {
{nextAvailable ? (
<Link
className="group flex w-40 flex-shrink-[1] items-center justify-end text-primary underline transition-all hover:font-bold"
href={`/${props.placement}/monthly/${nextDate.getFullYear()}/${nextDate.getMonth() + 1}`}
href={`/${props.placement}/monthly/${nextDate.getFullYear()}/${(nextDate.getMonth() + 1).toString().padStart(2, "0")}`}
>
{`${nextDate.getFullYear()}${nextDate.getMonth() + 1}月`}
<ChevronRightIcon size={"medium"} className="group-hover:scale-110" />
Expand Down

0 comments on commit d46c2c5

Please sign in to comment.