Changing date time picker form input

I wanted to have a form input that accept date input field only without the time. As far as I know, the xaraya date input form is using Tigra Calendar that also shows the time.

What I wanted to have is the input field without the time, and the date picker as well when clicked is not showing the time field. So after checking the tigra calendar specs, here’s what I did in my template file…

 
<input name="my_date" id="my_date_input" value="#$curdate#" size="10" maxlength="10" type="text">
<a href="javascript:my_date.popup()">
<img src="modules/base/xarimages/calendar.gif" alt="Click Here to Pick up the date" border="0" height="16" width="16">
</a>
 

as you see i used the popup() javascript call directly that available via the base’s calendar.js file.

and somewhere within the template I declare the “my_date” object:

 
<script language="JavaScript">
<!-- //
var match_date = new xar_base_calendar(document.forms['creatematchform'].elements['match_date'],'/xar-genesys');
match_date.year_scroll = true;
match_date.time_comp = false;
//-->
</script>
 

thats, it… maybe someone with more experience in xaraya will be able to show better pointer to me….

Tags: ,
Xaraya |

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

Hi there,

This was a wonderful find… exactly what I’m looking for.

Just one issue though - may just be me, but I cannot get it to work.

The JS popup doesn’t appear - the JS Error message is that “my_input” is not defined… ?

I’m making a Base Page…
themes / mytheme / modules / base / user-main-mydatesearchpage.xt

I copied your code, pasted it… nothing :(
I’ve tried putting the Declaration Script for the object both before and after the input.
I’ve even tried including the JS Call that is usually referred to by DD.

Still get the undefined error though :(

Was there something else you did - or am I just out of luck?

Much obliged - and keep up the good articles,
Autocrat

Leave a comment

(required)

(required)