Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Year in calendar picker
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Year in calendar picker
 Login/Join
 
Silver Member
posted
Currently the year in the calendar tool will only allow you to go back -50 years. Which means it is useless if you want to use it as a birthdate. What is the easiest solution to get around this since programming sees no need in changing this default?

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8

Windows, All Outputs
 
Posts: 48 | Location: Phoenix | Registered: March 01, 2018Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Could you provide us with the specific version of WebFOCUS 8 you're using?
Also, is this with the autoprompt or are you putting this in an HTML composer page in App Studio?

Sample fex would be very helpful too.


WebFOCUS 8206, Unix, Windows
 
Posts: 1822 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Virtuoso
posted Hide Post
From HTML composer, the calendar control settings can only go from +/-50 years.
Do not allow to go below or over that.

Maybe a NFR


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2298 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Master
posted Hide Post
Les
If this was Maintain, you could preset the variable populating the calendar with a date like 1930/01/01. When I click on the year drop down I see 1920 - 2030.

It looks like if you set a Static Value like that it works as well.

Mark
 
Posts: 661 | Location: New York | Registered: May 08, 2003Reply With QuoteReport This Post
Silver Member
posted Hide Post
I was able to get a work around from Tech Support using js. This allows the calendar year datepicker to go back 100 years.

var today = new Date();
var yy = today.getFullYear()-100;
var fromDate = new Date();
fromDate.setFullYear(yy, 0, 1);
var toDate = new Date();
toDate.setFullYear(toDate.getFullYear() + 100);
IbComposer_setCalendarDatesRange('calendar1', fromDate, toDate);


WebFOCUS 8

Windows, All Outputs
 
Posts: 48 | Location: Phoenix | Registered: March 01, 2018Reply With QuoteReport This Post
Master
posted Hide Post
Use a static date range and you can go back to 1850


Hallway
WF(Prod):8202M1
WF(Test):8202M4
OS/Platform:Win 10
Outputs:All
 
Posts: 564 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
Master
posted Hide Post
IBI uses jQueryUI for their forms, so the library is already loaded (along with jQuery) and in the 'Embedded Javascript' tab you can easily change any of the options listed here: https://api.jqueryui.com/datepicker/

Just do the following to put your custom calendar control:

  • Draw a Calendar control and note or change the unique ID. Example: 'calendar1.'
  • Go to the 'Embedded Javascript' tab at the bottom
  • In the function window_onload(), just add the few lines of code after the UpdateData() function call.

Here is an example that uses the jQuery animations to scale in from the button
  
function window_onload() {
    UpdateData();
    const calendar1 = document.getElementById('calendar1');
    $(calendar1).removeClass().datepicker({
        showAnim: "scale",
        showOptions: { origin: ["top", "right"] },
        showOtherMonths: true,
        selectOtherMonths: true,
        hideIfNoPrevNext: true,
        yearRange: '-100:+0',
        minDate: '-100y',
        maxDate: 0,
        changeMonth: true,
        changeYear: true,
        showOn: "button",
        buttonImage: "/ibi_apps/ibi_html/javaassist/ibi/html/maint/dynCalendar.png",
        buttonImageOnly: true,
        buttonText: "Select date",
    });
}


Hallway
WF(Prod):8202M1
WF(Test):8202M4
OS/Platform:Win 10
Outputs:All
 
Posts: 564 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Year in calendar picker

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.