Date formatters in server actions

Would it be possible to get the same date formatters in server actions that we have on the front end?

Server Side Options
image

Front end Options

I would like to use Get Day of the Week so I can create a table that has a row for each of the dates between my start and end dates, but also creates rows for the days before the first day back to the last Monday.

For instance, if I have dates of Feb 15 2024 to Feb 18 2024 I’d like to end up with a table

Feb 12 2024 (Monday) - Filler
Feb 13 2024 (Tuesday) - Filler
Feb 14 2024 (Wednesday) - Filler
Feb 15 2024 (Thursday) -Start Date
Feb 16 2024 (Friday) - Date
Feb 17 2024 (Saturday) - Date
Feb 18 2024(Sunday) - End Date

I tried using getDay but throws an error.

'Parser Error: Formatter "getDay" does not exist, expression {{query.trip_start_date.getDay()}}'

Dropping this here:

I think this FR contains missing date formatters.

In case it’s not possible, I use this in a project:
A table [with Excel and CSV upload (Heidi SQL works very well with CSV upload and MySQL)]


And a query where I extract the number, with condition “date”=“table date”

Recently I needed something similar, I did it through RunJS something like this

1 Like

Thanks for the suggestions. Looks like it’s been on the request list for a while. Hopefully we’ll get them soon.

I managed to do it with a custom query and then some conditions to make it work.

select `trip_id`, `number_of_days`, DAYOFWEEK(`trip_start_date`) as DOW, `trip_start_date` from `tbl_trips` WHERE `trip_id` = :P1

MySQL returns 1 as Sunday, 2 as Monday etc. but I wanted to start on Monday hence that first subtraction of 6 days.