Change date format on Reports

I dont think its urgent to be honest. I think its just a matter of convenience. Maybe it is something we could look into after the release of .61

1 Like

I agree, I only joined in here because the discussion started again but it was an old topic

I agree as well. This is not urgent.

In case anyone is wondering what is going on in my video demo. I used a Custom Report Widget to load the Work Period Report. I used an HTML widget and pointed it to load my calendar app that sits inside my SambaPOS/apps folder. The calendar app was a demo @emre provided while back.

I used A label widget at the top to display the venue name and the report date. The report date is read from a setting that is set from within the calendar picker app. I put a couple lines of jscript inside the HTML app to execute an automation command and feed the selected date into the command value. I used a rule to read that value and a Refresh Custom Report Widget action to update the date range of the report and refresh the widget.

Here is the code I inserted into the HTML app to allow the executing of automation command and set a localsetting:

window.external.ExecuteAutomationCommand('Report Date',this.getMoment().format('YYYY-MM-DD')),
window.external.SetLocalSettingValue('Report Date',this.getMoment().format('YYYY-MM-DD'))

I will document every step soon as I finish tweaking it a little and finding a more touch friendly calendar picker app.

5 Likes

@emre

Is it possible to replace the Reports date with date from Ticket Explorer.

This solved will also solve the issue with MM-DD-YYYY and DD-MM-YYYY.

I am fairly sure he answered why he has not changed that in this very post. Maybe he will change his mind


2 Likes

Make it a user-selectable option in Local Settings > Display section?

2 Likes

How can you format the date in such way that doesn’t reflect a time automatically? I’m working in a reservation workflow where you can edit the reservation, when I insert the date I have a mask that allows DD/MM/YY, when the information is inserted it shows DD/MM/YYYY, when I try to edit the information of the reservation it comes up llike this:

So how can I do to get rid of the 12:00 AM that shows there by default?? I already tried RegEx but it doesn’t work


Thank you in advance

Can you show the expanded rules you are using?

This is the rule to insert the date:

and this is the rule to edit the reservation fields:

Are you using the tasks Start Date or End Date fields for the dates? Or are you using a Custom Field? If I remember right, I believe the default Start/End Fields attach the time to the date.

On your reservation report, it looks like Date is displayed correctly.
JmkkYgDKnt

Do you have any other date columns you could possibly be accidently using? The default reservation setup uses a custom field for the date, the report field should be TSC.Date

I’m uisng TSC.Date in the report

Ok. I see what’s going on now. It looks like when the reservation is saved, it’s saving the time with the date (you can see it on the 2nd reservation on the below image).

I think the best option would be to format the date upon saving. There are 2 rules that would need to be updated:
RZV Handle Save Reservation (Add) &
RZV Handle Save Reservation (Update).
Change the date field to: [=FD('{LOCAL SETTING:RsDate}','dd/MM/yyyy')]
* If you have a different local setting name, use that one.

In the above image I Updated/saved the 1st reservation. You can see it stripped the time out. The 2nd reservation I did not update.

You may have to updated/save each reservation to update the date fields.

1 Like

how can I implement that here?

You can not enter it here
it would be possible using a script, but that would not be necessary. Prompt’s do not play well with other square brackets inside them, script calls usually do not have square brackets in them. What I am suggesting is to fix the underlying problem.

If you applied the fix to the Update rule, all you need to do is, in your reservation screen (probably the original screen), select the first reservation and click the “Save Reservation” button. There is no need to select a date or make any changes to anything
just select the first reservation, click “Save Reservation” and keep doing that, going down your list reservation list. Doing this update the Date field to the new format (dd/MM/yyyy). After that, the editing rules you are working on will have the date without the time.

Also, make sure you apply the fix to the Add rule also. This will save any future reservations in the proper date format.

I can not remember if the original reservation setup has a plain reservation report. If it does not, clone the Reservation List report and REMOVE the # from the first line of the report. It should start like this [Reservations:3,2..... (look at my previous post). Then rename & save the report. This will give you ability to view what & how the data is written in the database at any time.

1 Like

I will try that, thank you for your help

1 Like