Pop Up Calendar Component

I have a pop up calendar component where our users are going in and selecting the date each time they are entering information into the form. In the property editor I have the time style set to Start of day. The problem I’m having is that if someone selects a previous day(like yesterday) then the Date property in the data property editor will show 09/02/2020 00:00:00 but if they dont select a previous day because they are entering information for the current day then that date property will show 09/02/2020 08:11:24.

|---|---|---|---|
|2020-09-01 00:00:00.000|2|rhonda.yarbrough|ForkLifts|
|2020-09-01 00:00:00.000|2|catherine.cerra|Autodefecting|
|2020-08-31 22:40:29.540|3|tiffany.miller|Janitorial|
|2020-08-31 20:14:29.577|2|jacob.mcdonald|Maintenance|
|2020-08-31 15:09:26.537|1|gavin.ratliff|Finish|

The problem is that I have a table right next to the date selector that shows the users that have already entered information for the date selected. But if they entered already for the current day then they don’t show up in the table because the table is looking for 09/02/2020 00:00:00 reference not 09/02/2020 08:20:125

I do have a script running on the table:

Select t_stamp, Coordinator, Area
from SQDCME.dbo.SQDCME
where t_stamp = '{Root Container.ProductionDate.date}'

I would force an initial date with an expression binding on the date property of the popup calendar. Using something like:

midnight(now(0))

This will preset it for the start of day to match your time style setting and should solve your issue of the time being wrong if the user hasn’t changed the date yet. By using 0 for the now() function, it won’t poll which will allow the user to change the date. If you leave it blank or put anything else in there then it will poll preventing the user from picking the date they want.

Thank you! That worked perfectly!!

So last night when the coordinators entered their information into our SQL table the time still did not show correctly even though I did have that expression.

2020-09-02 23:07:46.753	3	seth.butler	Maintenance
2020-09-02 19:31:02.297	2	jacob.mcdonald	Maintenance
2020-09-02 15:20:50.407	1	randy.reese	RoughMill
2020-09-02 15:11:35.780	1	gavin.ratliff	Finish
2020-09-02 15:03:13.783	1	terri.horton	BlueLine
2020-09-02 15:03:13.783	1	terri.horton	GreenLine
2020-09-02 14:46:50.333	1	jeff.plunkett	Stacker_1
2020-09-02 14:32:40.553	1	jethey.henson	Stacker_2
2020-09-02 14:04:50.433	1	jessie.mcclellan	LumberDrying
2020-09-02 13:21:14.320	1	jeff.plunkett	ForkLifts

With this screen shot it looks like you have the expression on a binding on your root container. I would do it directly on the pop up calendar.

I guess I’m confused: I thought i did do the expression on the pop up calendar? From this screen shot you can see that the date property has a binding on it for the pop up calendar component.

I posted a reply then looked at how it shows up on my screen an I think I was wrong in what I was saying. I was assuming by the title on the binding popup that it was a custom property instead of the date binding, they just don’t list the .date in the title.

Does your script pull directly from the pop up calendar? If so have you tried print statements just to verify that it is passing correctly. I don’t see why it wouldn’t if its pulling directly from it.

When you added in the expression binding and saved/published, does it automatically update the clients or do they need to click on the bar at the top of the screen to load the changes? If so, did they accept the updates or where they still running on what was set up prior to the expression being put in?

This is the script that I have behind my submit button after all the selections have been made


As you can see from the circled area the script pulls the .date property from the pop up calendar.
Also I have the project set to update automatically.

By everything your showing I would think it should work unless the update didn’t push out correctly. I have only had issues with that one one system. With that one, I have to publish the changes twice before the client get the changes. I haven’t figured out why. That’s where a print statement would be good just for verifying it but I also know you don’t want to leave them in all the time. Personally, I would start with doing a print for ProductionDate. You could also on the dropdown itself do a print on load and when the date is changed to make sure it matches. You would do it with something like this in the property change script for the popup calendar:

if event.propertyName == 'componentRunning':
	print event.source.date
if event.propertyName == 'date':
	print event.newValue

If you don’t want to go through any of that, you can skip the expression and force the date to midnight in your script by doing:

ProductionDate = system.date.midnight(event.source.parent.getComponent('ProductionDate').date)