Position time input fields _next_ to date input field?

6 views
Skip to first unread message

Jens

unread,
May 30, 2010, 9:40:58 AM5/30/10
to calendar_date_select
Hello,

is there a way to take the time input fields out of the calendar
popup, and position them next to the text input field? So you get

[1___________] [2##] [3hh] : [4mm]

where

1: Calendar text input field for the date
2: Calendar icon for popup
3: Time input field for hour
4: Time input field for minutes

Thanks!

Jens

Shih-gian Lee

unread,
May 30, 2010, 10:39:59 AM5/30/10
to calendar_date_select
Hi Jens,

You can disable the time input fields. You can find out how to do that
from the demo - http://electronicholas.com/calendar. As I mentioned in
my previous post, you can setup callbacks to read in the value from
your own html time input fields and set the time in the Calendar Date
Select instance.

I hope that helps.

- Lee

Jens

unread,
May 31, 2010, 1:47:54 AM5/31/10
to calendar_date_select
Hello,

AFAIunderstand, the callbacks are javascript based, so if I have

<%= f.calendar_date_select :mydate, :time => false %>
<%= f.text_field :mytime %>

and the :time field is modified _after_ the calendar has been called,
I would have to add server-side logic to add mytime and mydate
together. Right? Or is there a way to connect the two fields client-
side, even if CalendarDateSelect is never instantiated (i.e. the user
manually types in a date into the text field)?

Jens


On May 30, 4:39 pm, Shih-gian Lee <shih....@gmail.com> wrote:
> Hi Jens,
>
> You can disable the time input fields. You can find out how to do that
> from the demo -http://electronicholas.com/calendar. As I mentioned in

Shih-gian Lee

unread,
May 31, 2010, 10:46:52 AM5/31/10
to calendar_date_select
Hi Jens,

You are correct. The callbacks are JS callbacks and they happen on
client side only. So, the easiest approach for you is to combine both
date and time on the server side.

The date display you are seeing in your input field is JS date and is
tied to the calendar date select. The calendar date select has
specific date format that needs to adhere to in order for it to work.
The only time you can set the value is during calendar date select
object initialization. Check out :default_date on this link -
http://code.google.com/p/calendardateselect/wiki/CalendarDateSelectParameters.

- Lee
Reply all
Reply to author
Forward
0 new messages