Merge pull request #39 from louim/bugfix/week-of-month

Replace nth_day_of_month with week_of_month
This commit is contained in:
Mohamad Tarbin
2026-01-18 12:56:58 -05:00
committed by GitHub
3 changed files with 7 additions and 7 deletions

View File

@@ -174,7 +174,7 @@ const ChoreEdit = () => {
// Validate advanced scheduling patterns
if (
frequencyType === 'days_of_the_week' &&
frequencyMetadata?.weekPattern === 'nth_day_of_month' &&
frequencyMetadata?.weekPattern === 'week_of_month' &&
(!frequencyMetadata?.occurrences ||
frequencyMetadata.occurrences.length === 0)
) {

View File

@@ -65,7 +65,7 @@ const DAYS = [
const WEEK_PATTERNS = {
every_week: 'Every week',
nth_day_of_month: 'Specific occurrences in the month',
week_of_month: 'Specific occurrences in the month',
}
const DAY_OCCURRENCE_OPTIONS = [
@@ -92,7 +92,7 @@ const generateSchedulePreview = metadata => {
}
if (
metadata.weekPattern === 'nth_day_of_month' &&
metadata.weekPattern === 'week_of_month' &&
metadata.occurrences?.length
) {
const occurrenceStr = metadata.occurrences
@@ -299,7 +299,7 @@ const RepeatOnSections = ({
Task repeats every week on selected days
</FormHelperText>
)}
{value === 'nth_day_of_month' && (
{value === 'week_of_month' && (
<FormHelperText>
Task repeats on specific day occurrences each month
(e.g., 1st Monday, 3rd Friday)
@@ -309,7 +309,7 @@ const RepeatOnSections = ({
))}
</RadioGroup>
{frequencyMetadata?.weekPattern === 'nth_day_of_month' && (
{frequencyMetadata?.weekPattern === 'week_of_month' && (
<Box mt={2}>
<Typography level='body-sm' mb={1}>
Select which occurrences of the selected days:

View File

@@ -431,7 +431,7 @@ export const parseRepeatV2 = inputSentence => {
result.frequencyType = 'days_of_the_week'
result.frequencyMetadata.days = [VALID_DAYS[dayName].toLowerCase()]
result.frequencyMetadata.weekPattern = 'nth_day_of_month'
result.frequencyMetadata.weekPattern = 'week_of_month'
result.frequencyMetadata.occurrences = [occurrence]
const startIndex = inputSentence
@@ -490,7 +490,7 @@ export const parseRepeatV2 = inputSentence => {
result.frequencyType = 'days_of_the_week'
result.frequencyMetadata.days = [VALID_DAYS[dayName2].toLowerCase()]
result.frequencyMetadata.weekPattern = 'nth_day_of_month'
result.frequencyMetadata.weekPattern = 'week_of_month'
result.frequencyMetadata.occurrences = occurrences
const startIndex2 = inputSentence