cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

Remove time from Calendar Box view

Elise_B
Level III

Hello,

I have a JSL code that asks the user to specify a time interval through a Calendar Box. My code works well I only wish to be able to suppress the display of the time which is not useful to me afterwards. Is it possible ?

 

undefined

 

 

dt1=Today(),
dt2=Today(),
HListBox(
 PanelBox( "From Time", scal = Calendar Box(SetFunction(Function({this}, date1=scal<< Get Date) ))),
 spacerbox(Size(20,20)),
 PanelBox( "To Time", ecal = Calendar Box(SetFunction(Function({this}, date2=ecal<< Get Date) )))
)

 

 

Thank you in advance for your answers !

This post originally written in French and has been translated for your convenience. When you reply, it will also be translated back to French .

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User


Re: Supprimer l'heure de l'affichage Calendar Box

I was able to change the visibility on the not required objects with the script below

txnelson_0-1625492919865.png

dt1 = Today();
dt2 = Today();
nw = New Window( "test",
	H List Box(
		Panel Box( "From Time",
			scal = Calendar Box( SetFunction( Function( {this}, date1 = scal << Get Date ) ) )
		),
		Spacer Box( Size( 20, 20 ) ),
		Panel Box( "To Time",
			ecal = Calendar Box( SetFunction( Function( {this}, date2 = ecal << Get Date ) ) )
		)
	)
);

nw[Text Box( 16 )] << visibility( collapse );
nw[Text Box( 8 )] << visibility( collapse );
nw[Number Edit Box( 4 )] << visibility( collapse );
nw[Number Edit Box( 2 )] << visibility( collapse );

See Craige Hales response below.

Jim

View solution in original post

Craige_Hales
Super User


Re: Supprimer l'heure de l'affichage Calendar Box

You might also like Select Date Range with Calendar Boxes  which links the two boxes together, forces the returned dates to midnight, and uses <<showTime(0) to remove the GUI elements.

Craige

View solution in original post

3 REPLIES 3
txnelson
Super User


Re: Supprimer l'heure de l'affichage Calendar Box

I was able to change the visibility on the not required objects with the script below

txnelson_0-1625492919865.png

dt1 = Today();
dt2 = Today();
nw = New Window( "test",
	H List Box(
		Panel Box( "From Time",
			scal = Calendar Box( SetFunction( Function( {this}, date1 = scal << Get Date ) ) )
		),
		Spacer Box( Size( 20, 20 ) ),
		Panel Box( "To Time",
			ecal = Calendar Box( SetFunction( Function( {this}, date2 = ecal << Get Date ) ) )
		)
	)
);

nw[Text Box( 16 )] << visibility( collapse );
nw[Text Box( 8 )] << visibility( collapse );
nw[Number Edit Box( 4 )] << visibility( collapse );
nw[Number Edit Box( 2 )] << visibility( collapse );

See Craige Hales response below.

Jim
Elise_B
Level III

Re: Remove time from Calendar Box display

It worked perfectly thank you very much!

This post originally written in French and has been translated for your convenience. When you reply, it will also be translated back to French .

Craige_Hales
Super User


Re: Supprimer l'heure de l'affichage Calendar Box

You might also like Select Date Range with Calendar Boxes  which links the two boxes together, forces the returned dates to midnight, and uses <<showTime(0) to remove the GUI elements.

Craige

Recommended Articles