Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Date and Time in DCT
dlukezic
Does anyone know if there is an existing script(s) similar to calendar.ipl that would allow a user filling out a DCT to choose both a date and a time? It could be two separate perl scripts, but one is preferred.
Or, does anyone know how I can do this?
Thanks,
Doreen
Find more posts tagged with
Comments
Adam Stoller
I don't know of an existing script for doing this - but I would imagine you could extend an existing calendar script to prompt for time entry too - and then have it send back all the information as a single formatted string (if you want it to fill in two different fields you could do that too, but you'd probably need to do more work to enable that kind of functionality in a customizable manner - e.g. passing in a parameter somehow that indicates the name of the other field).
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
Why not just drop-downs in the DCT? Do they need every minute, or just hours, or quarter hours? Adding a callout would not have the same performance and add unneeded custom code,
dlukezic
Thanks! The dropdowns are definitely my back up plan if there is not an existing callout.
Doreen
bcvbbbjnn
Hi Doreen
If you are interested in a drop down i hope the below code may help you.
The below code generates a drop down that displays dates starting from current date.
U can even set to get the time depending upon the "localtime" function in perl.
The below code displays 6 dates. The number of dates to be displayed depends upon the value of $n.
The logic here is a day has 86400 seconds (60*60*24)
# Author : Nirmal KrishnaIyer
my $l = localtime;
my $z=1;
my $n =0;
# This displays the current date
my
@a
= (localtime(time))[3..5];
printf "<option>%d-%d-%d</option>\n", $a[1] +1, $a[0], $a[2] + 1900;
print("\n");
# This displays the next 'n' dates depending upon the value of $n supplied.
do
{
@t
= (localtime(time+(86400*((($n+1)*$z)))))[3..5];
printf "<option>%d-%d-%d</option>\n", $t[1] +1, $t[0], $t[2] + 1900;
$n++;
}
while($n < 5 );
Please do excuse if the above said code doesnt favour ur requirement. I am just sharing my thoughts with u guys.
Regards
Nirmal KrishnaIyer
Project Engineer