Skip to content

Commit

Permalink
refactor: update flexible derived value
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenrui committed Nov 23, 2023
1 parent 4a8488a commit 9cd4ecd
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,9 @@ <h3 class="font-bold font-mono">AirBnB Search Bar:</h3>
id="time"
type="text"
:value="if (whenSelectedTab === 'Flexible') {
if (whenHowLong === 'Week') {
selectedMonths.length
? `Week in ${selectedMonths.join(', ')}`
: 'Any week'
} else if (whenHowLong === 'Weekend') {
selectedMonths.length
? `Weekend in ${selectedMonths.join(', ')}`
: 'Any weekend'
} else {
selectedMonths.length
? `Month in ${selectedMonths.join(', ')}`
: 'Any month'
}
selectedMonths.length
? `${whenHowLong} in ${selectedMonths.join(', ')}`
: `Any ${whenHowLong.toLowerCase()}`
} else if (whenSelectedTab === 'Months') {
const dates = getStartAndEndMonth(totalMonths);
const startDate = dates[0];
Expand All @@ -269,8 +259,6 @@ <h3 class="font-bold font-mono">AirBnB Search Bar:</h3>
year: 'numeric',
day: 'numeric',
});
date
} else {
''
}"
Expand Down

0 comments on commit 9cd4ecd

Please sign in to comment.