Here's a bit of javascript that will create a calendar for you... it won't
offset the date by the day number, but it's a start anyway...
<html>
<head>
<style>
.calendarDay
{
width: 100px;
float: left;
}
</style>
<script>
var monthStart = new Date(2013, 3, 1);
var monthEnd = new Date(2013, 3 + 1, 1);
var monthLength = (monthEnd - monthStart) / (1000 * 60 * 60 * 24) +1
// 1000 takes off milliseconds, 60 removes seconds, 60 minutes, 24 for
hours... now you have how many days.
function populateCalendar()
{
var mycal = document.getElementById("calendar");
mycal.innerHTML="";
for(var x = 1; x < monthLength+1; x++)
{
var day = document.createElement("div");
day.className="calendarDay";
day.innerHTML = "" + x
mycal.appendChild(day);
}
}
</script>
</head>
<body>
<button onclick="populateCalendar();">Start</button>
<div id="calendar" style="width:700px;">Calendar Goes Here</div>
</body>
</html>
On Monday, March 25, 2013 1:08:24 PM UTC-7, GStark wrote:
>
> Hi guys !
> I am new to web2py and I want to make a simple scheduler which could
> implement the following tasks:
> 1.Schedule events/tasks
> 2.Marking tasks as done.
> 3.Views to view tasks/events for this day/week/month (default by day)
> 4.Multiple users can register and make an account on the website to use
> it.A user can view only his own events and not others.
> 5.Admin interface to add standard events to all/specific section of users(
> such as "National holdicay " etc.)
>
> I have added some tables for events :
>
> db = DAL("sqlite://storage.sqlite")
>
>
> from gluon.tools import *
>
> crud = Crud(db)
> auth = Auth(db)
> auth.define_tables(username=True)
>
> db.define_table('events',
>
> Field('ev_name','string' ,label="Event Name"),
> Field('ev_desc','string',label="Event Description"),
> Field('ev_date','date',label="Event Date"))
>
>
> db.define_table('tasks',
> Field('t_name','string',label="Task Name"),
> Field('t_desc','string',label="Task Description"),
> Field('t_date','date',label="Task Date"),
> Field('t_time','time',label="Task Time")
> )
>
> I have implemented 2 buttons in my index page Event+ and Task+. I have
> done some simple navigation buttons too..
> I need to make a Month View and a day view for these events and Tasks with
> day view as default. I cant get any idea how to do it.. so please help me
> out
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.