Skip to content

Commit

Permalink
fix(reports): update year range when exporting congregation cards
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao committed Dec 8, 2024
1 parent bc90ace commit 246e8c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/features/reports/hooks/useCongregationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMemo } from 'react';
import { useRecoilValue } from 'recoil';
import { useAppTranslation } from '@hooks/index';
import { S21CardData, S21CardMonthData } from '@definition/report';
import { createArrayFromMonths, currentReportMonth } from '@utils/date';
import { createArrayFromMonths, currentServiceYear } from '@utils/date';
import { JWLangState, monthNamesState } from '@states/app';
import useReportMonthly from './useReportMonthly';

Expand All @@ -17,11 +17,11 @@ const useCongregationCard = () => {

const years = useMemo(() => {
const result: string[] = [];
const currentMonth = currentReportMonth();
const year = currentMonth.split('/')[0];
const prevYear = String(+year - 1).toString();

result.push(prevYear, year);
const currentYear = currentServiceYear();
const prevYear = String(+currentYear - 1).toString();

result.push(prevYear, currentYear);

return result;
}, []);
Expand Down
2 changes: 1 addition & 1 deletion src/views/reports/S21/shared/TableHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const TableHeader = ({ data }: S21Type) => {
<View style={[styles.cell, styles.column1]}>
<View style={styles.columnTwoRows}>
<Text style={[styles.label, styles.columnHeader]}>
{t('tr_serviceYear')}
{t('tr_serviceYear').replaceAll('-', '-\u000A')}
</Text>
<Text>{data.year}</Text>
</View>
Expand Down

0 comments on commit 246e8c8

Please sign in to comment.