node-red-dashboard - Chaining date selection from date-picker - dashboard

I have to invoke an API based on start_date, end_date and report_type. I know that the date picker does not support time selection which is unfortunate. However, I would like to use the widgets in my dashboard with the following constraints:
Do not enable end_date picker unless start_date picker selection is done.
start_date shouldn't be greater than current date.
end_date shouldn't be less than current date.
Enable drop-down for report_type only when start_date and end_date have been selected.
I have tried some variations of passing the selected value on to next node in flow, adding an object in msg.payload via a function node, etc. But, I can't seem to get the intended behavior. Worse, in one such attempt, I saw end_date defaulting to Unix epoch (Jan 1, 1970)!
Any suggestions on how to use time in date picker and 'chain' them as described above?

Related

Oracle Apex 19 - Date Picker - The application item stores the wrong 20th century, selecting a 19th date from the calendar

On my page I have an application item where the user has to select the date of birth from a date picker calendar. Since the user must be of age (according to Italian law) and I do not allow entry for people over 90, I have set the minimum and maximum to -100 and -18. When selecting the year, if the user selects a 19th century date from the date picker, the system mistakenly stores the corresponding 20th century year. How can I solve? I would like to avoid dividing the date into 3 distinct elements(day+month+year).
I solved the issue with explicit setting the format mask DD-MON-YYYY on the date picker application item. The YYYY format uses the selected century correctly. I guess that by default the date picker format considered is DD-MON-RRRR.
This helps
"What is the difference between 'YYYY' and 'RRRR' in Oracle SQL"
What is the difference between 'YYYY' and 'RRRR' in Oracle SQL

Applying case when date

I have to set the start date as 01-01-year which would be pulled from the expense date field. I have written the below query
select to_date(extract(year from rpt.expense_date),'yyyy') from rpt
How can I set the date to 01-01-year which would be pulled from above query.
Thanks in advance.
Use TRUNC to truncate to the start of the year:
SELECT TRUNC(expense_date, 'YY') FROM rpt
You can just truncate the date value:
trunc(rpt.expense_date, 'YYYY')
By default the trunc() function truncates to midnight on the specified day, equivalent to trunc(<date>, 'DD'), but you can use other elements.
In your code:
to_date(extract(year from rpt.expense_date),'yyyy')
you are only supplying the year element to to_date(); in that situation the other date elements default to the first day of the current month - so today that would give you June 1st in that year, not January 1st. That's hidden away a bit in the documentation:
If you specify a date value without a time component, then the default time is midnight. If you specify a date value without a date, then the default date is the first day of the current month.

Kendo datepicker select today onward only

I had this date range in here, but I want date from only can select today and onward only.
Meaning I cannot select date previous than today.
dateFrom >= today and dateUntil >= dateFrom
FULL DEMO
You can use min property of datepicker which will set the minimal date range. Updated dojo is here.

Alter a timestamp column in an oracle table with default value as '0000-00-00 00:00:00'

Can we assign a default value '0000-00-00 00:00:00' in oracle as we do in mysql as shown below ?
Sample query in mysql:
ALTER TABLE . MODIFY COLUMN TIMESTAMP DEFAULT '0000-00-00 00:00:00';
No - in Oracle neither year, month, or day can be set to zero. I suggest using NULL instead.
dbfiddle here
EDIT
Of course, having now gone back through one of my old questions and crawled down a wormhole or two I see that you can get a year of zero to be accepted - but it still appears that month and day cannot be zero. To get the year of zero in you have to use an ANSI date literal - e.g. DATE '0000-01-01' is considered acceptable. I don't know if the various date routines and date calculations will like this - for example, TO_CHAR(DATE '0000-01-01', 'DD-MON-YYYY') produces a result of '00-000-0000', which is certainly not what I'd expect, but perhaps it's good enough for your purposes. Note that you can't go the other way with this - TO_DATE('00-000-0000', 'DD-MON-YYYY') produces the expected ORA-01847 - day of month must be between 1 and last day of month error.
Does anybody really know what time it is..? :-)

Validating Date Prompt To be less than Current Date OBIEE

I have a requirement to create two validations on the date prompt:
1) The From Date has to be less than To Date
2) The To Date has to be less than or equal to current date
I created a conditional analysis wherein From Date is < To Date, which works, but when I try to create an advanced filter wherein #To_Date <= Current_Date I am getting an error.
Error getting drill information: SELECT date'2016-08-24' saw_0 FROM "Workforce Management - Processed Time Cards Real Time" WHERE(date'#{To_Date}' <= (SELECT VALUEOF("CURRENT_DATE_REP_OTBI") FROM "Workforce Management - Processed Time Cards Real Time" FETCH FIRST 1 ROWS ONLY))
If anyone can help solve this, it'd be really helpful!
Thanks
You need to add a default value when referencing presentation variables in logical SQL queries or formulas. Especially if these are dates.
I created an analysis based on the following LogicalSQL and it worked.
SELECT date'2016-08-26' saw_0 from "subject_area" WHERE (date
#{to_date}{'2016-08-26'} < CURRENT_DATE)
Notice the following:
The presentation variable #{to_date} goes with a default value (noted by the second curly brackets). This helps OBIEE to validate the query. Failing to add the default value will give you the "getting drill information" error.
Instead of a session RPD variable, you can use CURRENT_DATE. It simplifies the query.
The above query will return the date in the SELECT clause, but if the to_date is greater than CURRENT_DATE will return no data.

Resources