Skip to content

Commit b0e638c

Browse files
committed
fix daterange presets, fix e2e test
1 parent 24b62d4 commit b0e638c

File tree

3 files changed

+27
-28
lines changed

3 files changed

+27
-28
lines changed

e2e/projects.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ test('test that updating billable rate works with existing time entries', async
102102

103103
await page.getByRole('row').first().getByRole('button').click();
104104
await page.getByRole('menuitem').getByText('Edit').first().click();
105-
await page.getByText('Non-Billable').click();
105+
await page.getByText('Non-Billable').click();
106106
await page.getByText('Custom Rate').click();
107107
await page
108108
.getByPlaceholder('Billable Rate')
@@ -111,8 +111,8 @@ test('test that updating billable rate works with existing time entries', async
111111

112112
await Promise.all([
113113
page
114-
.getByRole('button', { name: 'Yes, update existing time entries' })
115-
.click(),
114+
.locator('button').filter({ hasText: 'Yes, update existing time' })
115+
.click(),
116116
page.waitForRequest(
117117
async (request) =>
118118
request.url().includes('/projects/') &&

resources/js/Components/ui/dialog/DialogContent.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,13 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
3333
<div
3434
:class="
3535
cn(
36-
'fixed top-0 left-0 z-50 pointer-events-none w-screen h-screen flex items-start pt-6 md:pt-20 xl:pt-32 justify-center overflow-auto data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
36+
'fixed top-0 left-0 z-50 pointer-events-none w-screen h-screen flex items-start pt-6 md:pt-20 xl:pt-32 justify-center overflow-auto',
3737
)"
3838
>
3939
<DialogContent
4040
v-bind="forwarded"
41-
4241
:class="cn(
43-
'bg-default-background grid w-full max-w-lg border border-border-tertiary shadow-lg duration-200 sm:rounded-lg',
42+
'bg-default-background grid w-full max-w-lg border border-border-tertiary shadow-lg duration-200 sm:rounded-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
4443
props.class,
4544
)"
4645
>

resources/js/packages/ui/src/Input/DateRangePicker.vue

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,18 @@ const open = ref(false);
7373
function setToday() {
7474
emit(
7575
'update:start',
76-
getLocalizedDayJs().startOf('day').format('YYYY-MM-DD')
76+
getLocalizedDayJs().startOf('day').format()
7777
);
78-
emit('update:end', getLocalizedDayJs().endOf('day').format('YYYY-MM-DD'));
78+
emit('update:end', getLocalizedDayJs().endOf('day').format());
7979
open.value = false;
8080
}
8181
8282
function setThisWeek() {
8383
emit(
8484
'update:start',
85-
getLocalizedDayJs().startOf('week').format('YYYY-MM-DD')
85+
getLocalizedDayJs().startOf('week').format()
8686
);
87-
emit('update:end', getLocalizedDayJs().endOf('week').format('YYYY-MM-DD'));
87+
emit('update:end', getLocalizedDayJs().endOf('week').format());
8888
open.value = false;
8989
}
9090
@@ -94,33 +94,33 @@ function setLastWeek() {
9494
getLocalizedDayJs()
9595
.subtract(1, 'week')
9696
.startOf('week')
97-
.format('YYYY-MM-DD')
97+
.format()
9898
);
9999
emit(
100100
'update:end',
101101
getLocalizedDayJs()
102102
.subtract(1, 'week')
103103
.endOf('week')
104-
.format('YYYY-MM-DD')
104+
.format()
105105
);
106106
open.value = false;
107107
}
108108
109109
function setLast14Days() {
110110
emit(
111111
'update:start',
112-
getLocalizedDayJs().subtract(14, 'days').format('YYYY-MM-DD')
112+
getLocalizedDayJs().subtract(14, 'days').format()
113113
);
114-
emit('update:end', getLocalizedDayJs().format('YYYY-MM-DD'));
114+
emit('update:end', getLocalizedDayJs().format());
115115
open.value = false;
116116
}
117117
118118
function setThisMonth() {
119119
emit(
120120
'update:start',
121-
getLocalizedDayJs().startOf('month').format('YYYY-MM-DD')
121+
getLocalizedDayJs().startOf('month').format()
122122
);
123-
emit('update:end', getLocalizedDayJs().endOf('month').format('YYYY-MM-DD'));
123+
emit('update:end', getLocalizedDayJs().endOf('month').format());
124124
open.value = false;
125125
}
126126
@@ -130,51 +130,51 @@ function setLastMonth() {
130130
getLocalizedDayJs()
131131
.subtract(1, 'month')
132132
.startOf('month')
133-
.format('YYYY-MM-DD')
133+
.format()
134134
);
135135
emit(
136136
'update:end',
137137
getLocalizedDayJs()
138138
.subtract(1, 'month')
139139
.endOf('month')
140-
.format('YYYY-MM-DD')
140+
.format()
141141
);
142142
open.value = false;
143143
}
144144
145145
function setLast30Days() {
146146
emit(
147147
'update:start',
148-
getLocalizedDayJs().subtract(30, 'days').format('YYYY-MM-DD')
148+
getLocalizedDayJs().subtract(30, 'days').format()
149149
);
150-
emit('update:end', getLocalizedDayJs().format('YYYY-MM-DD'));
150+
emit('update:end', getLocalizedDayJs().format());
151151
open.value = false;
152152
}
153153
154154
function setLast90Days() {
155155
emit(
156156
'update:start',
157-
getDayJsInstance()().subtract(90, 'days').format('YYYY-MM-DD')
157+
getDayJsInstance()().subtract(90, 'days').format()
158158
);
159-
emit('update:end', getDayJsInstance()().format('YYYY-MM-DD'));
159+
emit('update:end', getDayJsInstance()().format());
160160
open.value = false;
161161
}
162162
163163
function setLast12Months() {
164164
emit(
165165
'update:start',
166-
getLocalizedDayJs().subtract(12, 'months').format('YYYY-MM-DD')
166+
getLocalizedDayJs().subtract(12, 'months').format()
167167
);
168-
emit('update:end', getLocalizedDayJs().format('YYYY-MM-DD'));
168+
emit('update:end', getLocalizedDayJs().format());
169169
open.value = false;
170170
}
171171
172172
function setThisYear() {
173173
emit(
174174
'update:start',
175-
getLocalizedDayJs().startOf('year').format('YYYY-MM-DD')
175+
getLocalizedDayJs().startOf('year').format()
176176
);
177-
emit('update:end', getLocalizedDayJs().endOf('year').format('YYYY-MM-DD'));
177+
emit('update:end', getLocalizedDayJs().endOf('year').format());
178178
open.value = false;
179179
}
180180
@@ -184,14 +184,14 @@ function setLastYear() {
184184
getLocalizedDayJs()
185185
.subtract(1, 'year')
186186
.startOf('year')
187-
.format('YYYY-MM-DD')
187+
.format()
188188
);
189189
emit(
190190
'update:end',
191191
getLocalizedDayJs()
192192
.subtract(1, 'year')
193193
.endOf('year')
194-
.format('YYYY-MM-DD')
194+
.format()
195195
);
196196
open.value = false;
197197
}

0 commit comments

Comments
 (0)