DenRaf's Blog

  • Contact

Contact
View Raf Nijskens's profile on LinkedIn
OpenSource
Linux
Powered by Drupal, an open source content management system
Get Firefox
Fosdem
Visit Inuits Technical home

Locations of visitors to this page

Tags in TagCloud

6 acer ADP1 Android apache automaticmenu caching cats Centos closed source cron Debian dell Dell R200 deploy Dream driver drupal drupalcron eclair edit faceted_search fedora flat jscalendar Fosdem funambol G1 imagefield_gallery litejazz menu_tree module multiple domains mysql node_page O2Micro old openfire OSD otrs password trigger password_trigger plutado Ports presentation recover response header rpm svn sync syncml tagadelic ubuntu user filter user_import wordpress wordpress 2.3 wp2drupal xmlsitemap zabbix zimbra
more tags
Home » Blogs » DenRaf's blog

Flat jscalendar in Drupal 5

Submitted by DenRaf on Sat, 05/31/2008 - 12:40
  • [View]

How to make a flat jscalendar in drupal.

Download and install the jstools module and activate the jscalendar module.

Then in /path/to/jstools/jscalendar/jscalendar.js change the calendar setup into:

Calendar.setup({
flat : "calendar-container", // ID of the parent element
flatCallback : dateChanged // our callback function
});

And at the flatCallback function:
function dateChanged(calendar) {
// Beware that this function is called even if the end-user only
// changed the month/year. In order to determine if a date was
// clicked you can use the dateClicked property of the calendar:
if (calendar.dateClicked) {
// OK, a date was clicked, redirect to /yyyy/mm/dd/index.php
var y = calendar.date.getFullYear();
var m = calendar.date.getMonth() + 1; // integer, 1..12
var d = calendar.date.getDate(); // integer, 1..31
// redirect...
window.location = "/" + y + "/" + m + "/" + d + "index.php";
}
};

Then in your form:

$form['date'] = array(
'#type' => 'textfield',
'#attributes' => array('class' => 'jscalendar'),
'#jscalendar_showsTime' => 'false',
'#suffix' => '< div id="calendar-container" style="width: 100px;">< / div >',
);

Then I added display:none to nearly all entries in jscalendar.css so that the textbox and the image don't appear anymore.

It is not the cleanest way of doing things, but it works and you still can select the wished theme in your jscalendar settings.

  • DenRaf's blog
  • Add new comment
Tags:
  • drupal
  • drupal
  • flat jscalendar

Guided search

Click a term to initiate a search.

Categories

  • drupal (26)
  • Linux (6)
  • SysAdmin (6)
  • Uncategorized (5)
  • Linux-tools (3)

Date authored

  • 2010 (5)
  • 2009 (10)
  • 2008 (27)
  • 2007 (11)

TagCloud

  • drupal (26)
  • Ports (7)
  • cron (6)
  • drupalcron (6)
  • 6 (3)
  • OSD (3)
  • zimbra (3)
  • cats (2)
  • Fosdem (2)
  • funambol (2)
  • more...

Recent blog posts

  • OSD2010: Day 2
  • OSD2010: Day 1
  • OSD2010: Pre notes
  • Howto: Android 2.1 on G1/ADP1/Dream
  • Updated look
  • Zimbra monitoring with zabbix
  • New module: Node Page Template
  • AutomaticMenu module for drupal 6
  • Drupal synchronisation
  • Imagefield_gallery module for drupal 6
more

Recent comments

  • Thanks for the nice blog. It
    50 weeks 7 hours ago
  • I prefer this updated
    50 weeks 4 days ago
  • Agreed.
    1 year 14 weeks ago
  • Working on this
    1 year 16 weeks ago
  • Thanx for tutorial. IT'S
    1 year 17 weeks ago
  • Amon Ra recovery tool
    1 year 20 weeks ago
  • Please help me
    1 year 25 weeks ago
  • This is so dumb
    1 year 26 weeks ago
  • I've installed it on my
    1 year 29 weeks ago
  • I am also having the same
    1 year 30 weeks ago

Syndicate

Syndicate content
I love Smashing Magazine!
Fervens Drupal theme by Leow Kah Thong. Designed by Design Disease and brought to you by Smashing Magazine.