# Calender Script?

**URL:** <https://www.ruby-forum.com/t/calender-script/99840>\
**Category:** Rails\
**Created:** [July 25, 2006, 9:59pm UTC](https://www.ruby-forum.com/t/calender-script/99840 "2006-07-25T21:59:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![woow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7bcc69/32.png) [@woow](https://www.ruby-forum.com/u/woow)\
**Post date:** [July 25, 2006, 9:59pm UTC](https://www.ruby-forum.com/t/calender-script/99840/1 "2006-07-25T21:59:23Z")

</div>

I have been trying to get one of the calender javascripts to work with  
the \<%= form.text\_field. So when the user pick the date it updates the  
time fields? (like in normal reservation system where you pick up the  
date and time from the calender and when user pick the selection it  
updates the field) but I could not get this to work.

Does anyone have got something similar to work? or could someone help me  
with this.

thanks

---

<div class="post-metadata">

**Author:** ![woow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7bcc69/32.png) [@woow](https://www.ruby-forum.com/u/woow)\
**Post date:** [July 26, 2006, 3:29am UTC](https://www.ruby-forum.com/t/calender-script/99840/2 "2006-07-26T03:29:02Z")

</div>

woow wrote:

> I have been trying to get one of the calender javascripts to work with  
> the \<%= form.text\_field. So when the user pick the date it updates the  
> time fields? (like in normal reservation system where you pick up the  
> date and time from the calender and when user pick the selection it  
> updates the field) but I could not get this to work.
> 
> Does anyone have got something similar to work? or could someone help me  
> with this.
> 
> thanks

any help???

---

<div class="post-metadata">

**Author:** ![woow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7bcc69/32.png) [@woow](https://www.ruby-forum.com/u/woow)\
**Post date:** [July 26, 2006, 3:58am UTC](https://www.ruby-forum.com/t/calender-script/99840/3 "2006-07-26T03:58:56Z")

</div>

Hello,

We use this calendar in our rails apps:  
[http://dynarch.com/mishoo/calendar.epl](http://dynarch.com/mishoo/calendar.epl)

> From below is taken from our views. We end up parsing the results (in the  
> case its called newSchDate) manually into our Activerecord date…

```
<link rel="stylesheet" type="text/css" media="all"

```

href=“/calendar/calendar-win2k-1.css” title=“blue” /\>

```
<!-- main calendar program -->
<script type="text/javascript" src="/calendar/calendar.js"></script>

<!-- language for the calendar -->
<script type="text/javascript" src="/calendar/lang/calendar-en.js

```

"\>

```
<!-- the following script defines the Calendar.setup helper 

```

function,  
which makes  
adding a calendar a matter of 1 or 2 lines of code. →

```
   <input type="text" name="newSchDate" id="newSchDate" readonly="1"

```

value=“\<%= @params[:newSchDate] %\>”/\>  
 ![](https://www.ruby-forum.com/calendar/img.gif "Date selector")

---

<div class="post-metadata">

**Author:** ![woow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7bcc69/32.png) [@woow](https://www.ruby-forum.com/u/woow)\
**Post date:** [July 26, 2006, 6:27pm UTC](https://www.ruby-forum.com/t/calender-script/99840/4 "2006-07-26T18:27:14Z")

</div>

available as a Rails bundle here:

[http://blog.inquirylabs.com/2006/01/26/bundled-resource-v-09-full-dynarch-calendar-support/](http://blog.inquirylabs.com/2006/01/26/bundled-resource-v-09-full-dynarch-calendar-support/)

---

<div class="post-metadata">

**Author:** ![woow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7bcc69/32.png) [@woow](https://www.ruby-forum.com/u/woow)\
**Post date:** [July 26, 2006, 6:56pm UTC](https://www.ruby-forum.com/t/calender-script/99840/5 "2006-07-26T18:56:03Z")

</div>

FranÃ§ois Montel wrote:

> available as a Rails bundle here:
> 
> [http://blog.inquirylabs.com/2006/01/26/bundled-resource-v-09-full-dynarch-calendar-support/](http://blog.inquirylabs.com/2006/01/26/bundled-resource-v-09-full-dynarch-calendar-support/)

Thanks…and I am trying to include the fallowing in one of my already  
exsiting application and its kind of confusing how I could do this…is  
it possible for u to redirect or give me step be step instructions…I  
am new to ruby…

Thanks

---

<div class="post-metadata">

**Author:** ![woow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7bcc69/32.png) [@woow](https://www.ruby-forum.com/u/woow)\
**Post date:** [July 26, 2006, 4:41pm UTC](https://www.ruby-forum.com/t/calender-script/99840/6 "2006-07-26T16:41:52Z")

</div>

Stephen.

Thank you so much…Is it possible for you to share the link to your  
website or how I can use this calender script? So I can take look at the  
code…and get it to work at my end?

Thank you again

Stephen wrote:

> Hello,
> 
> We use this calendar in our rails apps:  
> [http://dynarch.com/mishoo/calendar.epl](http://dynarch.com/mishoo/calendar.epl)
> 
> > From below is taken from our views. We end up parsing the results (in the  
> > case its called newSchDate) manually into our Activerecord date…
> 
> ```
> <link rel="stylesheet" type="text/css" media="all"
> 
> ```
> 
> href=“/calendar/calendar-win2k-1.css” title=“blue” /\>
> 
> ```
> <!-- main calendar program -->
> <script type="text/javascript" src="/calendar/calendar.js"></script>
> 
> <!-- language for the calendar -->
> <script type="text/javascript" src="/calendar/lang/calendar-en.js
> 
> ```
> 
> "\>
> 
> ```
> <!-- the following script defines the Calendar.setup helper 
> 
> ```
> 
> function,  
> which makes  
> adding a calendar a matter of 1 or 2 lines of code. →
> 
> ```
> <input type="text" name="newSchDate" id="newSchDate" readonly="1"
> 
> ```
> 
> value=“\<%= @params[:newSchDate] %\>”/\>  
> ![](https://www.ruby-forum.com/calendar/img.gif "Date selector")

---

<div class="post-metadata">

**Author:** ![woow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7bcc69/32.png) [@woow](https://www.ruby-forum.com/u/woow)\
**Post date:** [July 27, 2006, 11:53am UTC](https://www.ruby-forum.com/t/calender-script/99840/7 "2006-07-27T11:53:55Z")

</div>

> and that’s it… 1-2-3 !

Concise & Impressive!

Does it work transparently when saving/updating.

text\_field like ‘27-07-2007’ have to be converted too suit the date  
type in the db ?

Did it need some changes in the controller ?

Thanks

---

<div class="post-metadata">

**Author:** ![woow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7bcc69/32.png) [@woow](https://www.ruby-forum.com/u/woow)\
**Post date:** [July 27, 2006, 7:51am UTC](https://www.ruby-forum.com/t/calender-script/99840/8 "2006-07-27T07:51:22Z")

</div>

woow wrote:

> FranÃ§ois Montel wrote:
> 
> > available as a Rails bundle here:
> > 
> > [http://blog.inquirylabs.com/2006/01/26/bundled-resource-v-09-full-dynarch-calendar-support/](http://blog.inquirylabs.com/2006/01/26/bundled-resource-v-09-full-dynarch-calendar-support/)
> 
> Thanks…and I am trying to include the fallowing in one of my already  
> exsiting application and its kind of confusing how I could do this…is  
> it possible for u to redirect or give me step be step instructions…I  
> am new to ruby…
> 
> Thanks

a big hammer to kill a fly… I tried too but I found a much simpler,  
neat and useful solution at :

> **[frequency-decoder.com](http://www.frequency-decoder.com/demo/fd-date-picker/)**
>
> This domain may be for sale!

1- js and media folders to be moved into your public folder  
2- insert 2 lines in your layout   
\<%= stylesheet\_link\_tag “scaffold”, “fd\_datepicker”, :media =\>  
“all” %\>

3- insert the tag in your form  
My Date  
  
\<%=  
text\_field\_tag(‘mydate’, @mydate, {:class =\> “format-d-m-y”, :readonly  
=\> “readonly”, :maxlength =\> “25”} )  
%\>

you can also modify the class according to the demo… replacing  
“format-d-m-y” by @mydateclass

and that’s it… 1-2-3 !

kad

---

<div class="post-metadata">

**Author:** ![woow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7bcc69/32.png) [@woow](https://www.ruby-forum.com/u/woow)\
**Post date:** [July 27, 2006, 12:03pm UTC](https://www.ruby-forum.com/t/calender-script/99840/9 "2006-07-27T12:03:19Z")

</div>

You know, while I’ve downloaded it for future use in an application, I  
haven’t actually tried it, so I don’t know exactly how it works or what  
steps you would need to take to make it work for you. (I’m pretty new to  
Ruby myself.)
