Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Dynamic Calendar Default Value

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Dynamic Calendar Default Value
 Login/Join
 
Member
posted
I just upgraded to WebFocus 7.1 and I am using the dyanmic calendar control in the Resource Layout tool. The calendar is working just fine, however, I need to find a way to have the Calendar default to yesterday's date. This looks to be some kind of Javascript property that is used in the Value field for the Calendar. Has anyone been able to successfully set this value?
 
Posts: 15 | Location: Wichita, KS | Registered: June 01, 2005Report This Post
Expert
posted Hide Post
Johnny,


Insert the following code between script tags in your HTML and then call it from within the OnLoad() function. It will populate every calendar control with yesterdays date.

    function PrepDates() {
var today = new Date( );
today.setDate(today.getDate() - 1);
var t_date = today.getDate();
if (t_date<10) {t_date='0'+t_date};
var t_mnth = today.getMonth()+1;
if (t_mnth<10) {t_mnth='0'+t_mnth};
var t_year = today.getFullYear();
t_year = t_year - 2000 ;
if (t_year<10) {t_year='0'+t_year};
var end_date = t_date+"/"+t_mnth+"/"+t_year;

for (i=0;i {
if (document.all(i).elementtype == "editcalendar")
{
this.displayElement = document.getElementById (document.all(i).id);
this.displayElement.value = end_date;
}
}
}
Someone might be able to tidy the code for you but it does work in its current form.

T

This message has been edited. Last edited by: <Maryellen>,



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
In version 7.1 I do this type of thing almost the same way I did it in 5.x. In layout tool, set the value of the calender control to !IBI.AMP.YSTDAY; (or whatever parm name you like). Create a .fex file that contains:

-SET &YSTDAY=AYMD(&YYMD,-1,'I8YYMD');
-HTMLFORM htmlname.htm

Should do the trick.
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Member
posted Hide Post
Thanks for all the help. I got it to work, using a little bit different Javascript method. Issue resolved for now.
 
Posts: 15 | Location: Wichita, KS | Registered: June 01, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Dynamic Calendar Default Value

Copyright © 1996-2020 Information Builders