aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-07-18 18:06:38 -0400
committerLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-07-18 18:06:38 -0400
commitdff0ae504ac7c1cc4e3b45c4e316d5a0d55e75c3 (patch)
treee7c6a2cfd9749c38b18e785e741fc3f55d5a7945
parent4e2c2121d3169e45a8714bdd69812391f36c686f (diff)
parent7991399bef62a0c13178ccca3e7cbd0da768455f (diff)
downloaddonetick-frontend-dff0ae504ac7c1cc4e3b45c4e316d5a0d55e75c3.tar.gz
donetick-frontend-dff0ae504ac7c1cc4e3b45c4e316d5a0d55e75c3.tar.bz2
donetick-frontend-dff0ae504ac7c1cc4e3b45c4e316d5a0d55e75c3.zip
Merge branch 'dev'
Diffstat (limited to '')
-rw-r--r--src/views/ChoreEdit/RepeatSection.jsx26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/views/ChoreEdit/RepeatSection.jsx b/src/views/ChoreEdit/RepeatSection.jsx
index bdf6738..94d16c8 100644
--- a/src/views/ChoreEdit/RepeatSection.jsx
+++ b/src/views/ChoreEdit/RepeatSection.jsx
@@ -116,6 +116,7 @@ const RepeatOnSections = ({
onClick={() => {
setIntervalUnit(item)
onFrequencyMetadataUpdate({
+ ...frequencyMetadata,
unit: item,
})
}}
@@ -167,6 +168,7 @@ const RepeatOnSections = ({
}
onFrequencyMetadataUpdate({
+ ...frequencyMetadata,
days: newDaysOfTheWeek.sort(),
})
}}
@@ -247,6 +249,7 @@ const RepeatOnSections = ({
}
onFrequencyMetadataUpdate({
+ ...frequencyMetadata,
months: newMonthsOfTheYear.sort(),
})
console.log('newMonthsOfTheYear', newMonthsOfTheYear)
@@ -363,7 +366,15 @@ const RepeatSection = ({
onFrequencyUpdate(1)
onFrequencyMetadataUpdate({
unit: 'days',
+ time: frequencyMetadata?.time
+ ? frequencyMetadata?.time
+ : moment(
+ moment(new Date()).format('YYYY-MM-DD') +
+ 'T' +
+ '18:00',
+ ).format(),
})
+
return
}
onFrequencyTypeUpdate(item)
@@ -419,11 +430,20 @@ const RepeatSection = ({
}
onFrequencyTypeUpdate(item)
if (item === 'days_of_the_week') {
- onFrequencyMetadataUpdate({ days: [] })
+ onFrequencyMetadataUpdate({
+ ...frequencyMetadata,
+ days: [],
+ })
} else if (item === 'day_of_the_month') {
- onFrequencyMetadataUpdate({ months: [] })
+ onFrequencyMetadataUpdate({
+ ...frequencyMetadata,
+ months: [],
+ })
} else if (item === 'interval') {
- onFrequencyMetadataUpdate({ unit: 'days' })
+ onFrequencyMetadataUpdate({
+ ...frequencyMetadata,
+ unit: 'days',
+ })
}
// setRepeatOn(item)
}}