Skip to content

Commit

Permalink
refactor: update code to contain declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenrui committed Nov 23, 2023
1 parent c0dee69 commit 5ab74a7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -381,20 +381,20 @@ <h3 class="font-bold font-mono">AirBnB Search Bar:</h3>
:class="whenSelectedTab === 'Months' ? 'bg-white ring-1 ring-gray-300' : 'hover:bg-gray-300'"
:click="whenSelectedTab = 'Months';
selectedTab = 'When';
el.today = new Date();
el.startMonth = el.today.getMonth() + 1;
el.endMonth = el.today.getMonth() + 1 + 3;
const today = new Date();
const startMonth = today.getMonth() + 1;
const endMonth = today.getMonth() + 1 + 3;
el.startDate = new Date(el.today.getFullYear(), el.startMonth, 1);
el.endDate = new Date(el.today.getFullYear(), el.endMonth, 1);
const startDate = new Date(today.getFullYear(), startMonth, 1);
const endDate = new Date(today.getFullYear(), endMonth, 1);
time = el.startDate.toLocaleString('default', {
time = startDate.toLocaleString('default', {
month: 'short',
year: 'numeric',
day: 'numeric',
});
time += ' - ';
time += el.endDate.toLocaleString('default', {
time += endDate.toLocaleString('default', {
month: 'short',
year: 'numeric',
day: 'numeric',
Expand Down

0 comments on commit 5ab74a7

Please sign in to comment.