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     [CLOSED] Default Values for calendar control

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Default Values for calendar control
 Login/Join
 
Guru
posted
Hi,

I have 2 calendar controls..One for start date and another for end date in the MDYY format.
Initially,both the calendar controls should be blank and only when the user clicks on them, the default value for the start date should always be the May 1st of the previous year and default value for the end date should be the sys date.

Could anyone please let me know how to do this?

Thanks a lot in advance!

Regards,
IP

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


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report This Post
Member
posted Hide Post
Hi IP,

Try this code on the 'onClick' event of calendar control, this works for me every time.

function calendar1_onclick(ctrl)
{

var NewToday = new Date();
var Today = new Date(NewToday.getFullYear(), NewToday.getMonth(), NewToday.getDate());
var DateMM = Today.getMonth() + 1;
// javascript months are 0 through 11
var DateDD = Today.getDate();
var DateYYYY = Today.getFullYear();
var DatePrevYY = DateYYYY - 1;
< !-- need 2-digit months and days and 4-digit years -->
if (DateMM < 10) DateMM = '0' + DateMM;
if (DateDD < 10) DateDD = '0' + DateDD;
document.getElementById('calendar1').value = '05' + '/01/' + DatePrevYY;
}
function calendar2_onclick(ctrl)
{
var NewToday = new Date();
var Today = new Date(NewToday.getFullYear(), NewToday.getMonth(), NewToday.getDate());
var DateMM = Today.getMonth() + 1;
// javascript months are 0 through 11
var DateDD = Today.getDate();
var DateYYYY = Today.getFullYear();

< !-- need 2-digit months and days and 4-digit years -->
if (DateMM < 10) DateMM = '0' + DateMM;
if (DateDD < 10) DateDD = '0' + DateDD;
document.getElementById('calendar2').value = DateMM +'/'+ DateDD +'/'+ DateYYYY;
}


WebFOCUS release 7.7.03, HTML, PDF, Excel
 
Posts: 1 | Registered: March 18, 2014Report This Post
Guru
posted Hide Post
Hi Pranav,

Thanks for the quick response but unfortunately it is throwing this javascript error message when I click on the 1st calendar control:

Line:37
Char:1
Error:'DatePrevYY' is undefined
Code :0

Please let me know!

Thanks a lot in advance!


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report This Post
Guru
posted Hide Post
It won't throw JS error if you comment out unwanted lines
//Begin function calendar1_onclick
function calendar1_onclick(ctrl) {
var NewToday = new Date();
var Today = new Date(NewToday.getFullYear(), NewToday.getMonth(), NewToday.getDate());
var DateMM = Today.getMonth() + 1;
// javascript months are 0 through 11
var DateDD = Today.getDate();
var DateYYYY = Today.getFullYear();
var DatePrevYY = DateYYYY - 1;
//< !-- need 2-digit months and days and 4-digit years -->
if (DateMM < 10) DateMM = '0' + DateMM;
if (DateDD < 10) DateDD = '0' + DateDD;
document.getElementById('calendar1').value = '05' + '/01/' + DatePrevYY;
}
//End function calendar1_onclick


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Guru
posted Hide Post
Hi,

Rifaz - I did the same but sometimes it works and most of the times,it is throwing this error message as shown below :

Line :7
Char :764
Error:Unable to get value of the property '0'Red Facebject is null or undefined Code :0
URL:http://wfdev.corp.intranet/ibi_apps/ibi_html/javaassist/ibi/html/js/rltcale-
ndarInit.js

Thanks,
IP


Webfocus 8105 Developer studio,Windows 7,HTML,Excel,PDF,Text,Infoassist,Graph,AHTML
 
Posts: 270 | Registered: October 30, 2014Report 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     [CLOSED] Default Values for calendar control

Copyright © 1996-2020 Information Builders