Struts 2 datetimepicker defaults to 31/12/1969 - struts2

I face 2 issues while using struts 2 datetimepicker.
1. The value in datetimepicker field does not persist when the page is refreshed or when we click the back button from the next page
2. When an invalid date is entered in the field, the value defaults to 31/12/1969 or the previously selected date when the field loses focus.
Is there a way to overcome these?

You need to show us the relevant parts of the code you're using, so we can see the problem. Note that 31 December 1969 (actually midnight UTC on 1 January 1970) is time 0 in Java(Script) and many other systems influenced by UNIX.

Related

xforms - orbeon Date field input correction

I'm trying to get rid of fixing date input by user on Date field in Orbeon forms.
I had formatted my Date field to DD/MM/YYYY and when I type:
44/07/2022
It automatically changes to 13/08/2022 (moves extra days to next month)
I just want to validate wrong input without "fixing" it and ask user to correct it by himself. Is it possible to disable this feature by prop or make any workarounds? I checked documentation and didn't find any clues.

Cognos - value prompt to display months from january to december

For a monthly report need to display the months January to December in the value prompt. Could you please advise how to achieve this.
Welcome Immi
I do not know what data items are available on the package you are using
However, you can create static values with a value prompt
Look in properties for the value prompt, static. Select the ellipsis
Then add the values
Depending on the version of Cognos, you can search the data items (worst case do this manually, maybe you will luck out and there is a query subject for dates). Look around and see if months is in the package. If they exist, add them to the value prompt query subject and give it a try
Also to consider, your take may require 13 month accounting, displaying the month name won't work in that case.
As far as value prompts there is a display value and a use value
The month name can be the display value and if you need for filtering the month #, that can be the use value.
https://www.ibm.com/docs/en/opw/8.0.0?topic=prompts-adding-static-choices-prompt

Create a dynamic parameter to update the graph when a user zooms in. (tableau)

I have a time series graph that loads the initial values using the start date and end date parameters to the right, as seen in the picture below. I need to set it up to update the date range to whatever date range the user zooms into.
Any suggestions on how to setup a dynamic parameter for date ?
For reference, the updated date will hit a database function in Postgres which will return more granular data for smaller date ranges instead of down sampling for a large range.
Clarification based on comments:
the report loads up and the graph is blank
user selects start date and end date in the parameters, the data for this range is loaded from the DB
the graph loads up and the user can zoom and pan in the graph
when the user zooms in, the date range in the graph updates. in the picture... the date range is from Aug 2020 to March 2021, but the user is zoomed into Jan.
Asking for: when zoomed in like in step 4, I want to update the Date Start and Date End with the zoomed in Values, so in this case, 12th Aug 2020 should become 1 Jan 2021 and end date should become 2 Jan 2021
Please check this one,
1-Date Granularity
Good luck.

Datetime and Time Zones - OpenERP 7

I'm keeping the current date in a model using a datetime field in which I am indicating default to take the current date as a value.
_defaults = {
'f_inicio' : lambda *a: datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
}
Assuming that the current date is '07/10/2013 17:24:05 ', in the view is the date '07/10/2013 12:24:05' and rectified in the database and the date is '07/10/2013 17:24:05'; gather that this subtracting five hours. The user can set the time zone 'America/Bogota', Colombia is in the region (GTM - 5:00). But do not understand how to properly show when the user since I get a totally different value that should show. Apparently this taking as 'GTM 0' the GTM Colombia. Taking the approximate date create_date field that should have given me as default is '2013-10-07 22:24:05.384'.
Anyone have any idea what may be happening, really appreciate any help on this issue that is driving me crazy.
This drived me too crazy in the past. This is a real simple issue.
The date stored in the database is UTC (GMT-0) timezone. Assume that the person is set with timezone GMT - 5:00, then while storing the value to the database, the date will be added with 5 hrs (exactly 5, not little more or little less) and thus we get the UTC time to store into the database. Now when displaying the same it will check for the users timezone and it finds that its GMT - 5:00 so the database time will be subtracted with 5 (again exactly 5, not little more or little less) and displayed the user.
This will be great for system which is used in different timezones. So the understanding is the input is taken in the user's timezone stored in UTC(GMT-0) and displayed to user's timezone (even if the user viewing is in the different timezone the time will be accurate to their timezone)
Note: if the user is not set with the timezone the browsers timezone is considered and will be used with the warning icon on the top corner
That's it. Hope this gives u better clarity!!

Rails app - how to enter events in local time zone

I am working on a Rails app that displays a sports schedule (in a basic table). Each game/event is a db table row. The customer wants all the events to display in chronological order but to also display the time in the event's local timezone.
How can I add a timezone selector to the New action? So that when the customer enters events they can select the event's timezone and input the event's time in that timezone.
Here is what the schedule would look like:
Event 1 7:00 pm EST
Event 2 5:00 pm PST
Event 3 7:00 pm PST
I personally think this is confusing, but it's what they want. Thanks in advance.
Geoff Buesing wrote a great primer on Rails support of time zones back when 2.1 was released.
Okay I am not so sure I understood your question directly but here is my line of thinking there is a library I passed along called tzinfo which is supposed to give Rails the ability to work with timezones so my guess is do the following build a list for a select box (wikipedia has a good complete list) when the user selects the timezone send it to the server which will calculate the appropriate timings now and send back (maybe depending on your architecture you could send only the added hours that should be added or subtracted)

Resources