Topic: About annual calendar
Hello all MVD users and Dmitry
With MVD, is it possible to display on a form an annual calendar with 12 months displayed together (Juanary to December) ?
Any example to illustrate it ?
Thanks by advance
JB
My Visual Database → General → About annual calendar
Hello all MVD users and Dmitry
With MVD, is it possible to display on a form an annual calendar with 12 months displayed together (Juanary to December) ?
Any example to illustrate it ?
Thanks by advance
JB
Bonsoir Jean,
I'm not sure if this will give you any ideas.
Regards,
Derek.
Hello guys,
My contribution : not as clean and smart as derek's
With Saturdays, Sunday and French Holly Days.
Cheers
Mathias
Hi Guys,
Derek,
Thanks for sharing... Nice little application.
1. I guess it's not possible to customize calender as shown on your screen cap. in MVD?
2. How did you populate drop-down combo boxes? There is no form to add items for them, no calc. fields and I couldn't see hard coded items.
Mathias,
Thank you for sharing sample year calender..... Interesting approach using tGrid. It could be a manual workaround for calender as MVD calender component is very basic and doesn't support few things needed when one wants to use in a reminders etc. app.
What we need are:
1. Ability to click on a cell (single and double-click) to select a day to add events to it.
2. Enabling user to add a small image (with max constrains of 32x32 px) in day cell to highlight there is a some kind of entry for the day.
3. For weekends and holidays we could use font coloring rather than cell coloring.
Question:
How did you fill months and days on your tGrid?
Hello Derek, Mathmatou and AD1408
Thanks for your own calendar
Derek : A little after posting my question, I realized by stretching Calendar component, I coul obtain an annual calendar. Thanks again
Mathmatou : your answer suits to me. I wish use your calendar to manage the rentals of a cottage during the holidays.
As says AD1408, how can I fill cells of a different color for a certain length of time (ie from 1 July to 15 July)?
Thnaks
JB
Hello all,
I've worked a little on you question, and here is what I came up with, after creating a table to save bookings :
procedure Form1_Button2_OnClick (Sender: string; var Cancel: boolean);
var
bookings : TDataSet;
s_month, s_day, e_month, e_day : Integer; //STARTING AND ENDING DAYS, MONTHS
r, c : Integer; //Row, Column
nb_day_s_month, nb_day_e_month, x, y : Integer;
begin
SQLQuery('SELECT '+
'strftime("%m",booking_start) AS SM,'+
'strftime("%d",booking_start) AS SD,'+
'strftime("%m",booking_end) AS EM,'+
'strftime("%d",booking_end) AS ED '+
'FROM '+
'booking',bookings);
while not bookings.Eof do
begin
s_month := Bookings.FieldByName('SM').AsInteger; //Start Month
s_day := Bookings.FieldByName('SD').AsInteger; //Start Day
e_month := Bookings.FieldByName('EM').AsInteger; //End Month
e_day := Bookings.FieldByName('ED').AsInteger; //End Day
for c := s_day to e_day do
begin
for r := s_month - 1 to e_month - 1 do
begin
Form1.TableGrid1.Cell[c,r].Color := clGreen;
end;
end;
bookings.Next;
end;
bookings.Free;
end;
Unfortunately, this code works only if start and end date for the stay are in the same month.
A soon as the reservation spans over tow or more moth, it does not work anymore.
I spent some time trying to figure out how to arrange this, but professional life is too heavy on me right now, and I can not spend enough time on it to solve the problem.
This is probably limited by the way I arranged the dates in my database
Have fun guys and post your solutions if you find some
Cheers
Mathias
After checking samples in SQLite studio I noticed that Derek and Mathias populated items in question manually. If I'm wrong please correct me.
Mathias, if and when you have a time if you could add following futures to your calendar sample app, it would be great.
1. Ability to click on a cell (single and double-click) to select a day to add events to it.
2. Enabling user to add a small image (with max constrains of i.e. 32x32 px) in day cell to highlight there is a some kind of entry for the day.
3. For weekends and holidays we could use font coloring rather than cell coloring.
Hello Jean, Mathias, Adam,
I've been away so only just now catching up on comments in the forum.
Jean, I'm not sure if it helps but attached is a little application I wrote a while ago when I was VERY new to MVD (which is why the script is terrible - LOL!). I use it for simple diary / notes / reminders but I'm sure if you changed the labels, you could use it for bookings.
In the meantime, I might 'steal' some of Mathias' good ideas and try and develop it around tgrid more.
Adam - correct, it was simpler and quicker to knock up the data in Excel and then import it into sqlite so that each day is already there, as a container, waiting for any notes to be written.
Regards,
Derek.
Hello Derek,
I am trying to build a doctor's appointment calendar based on your example. However, double-clicking the date in calendar produces an error message and fails to open the desired search result. The button2 does not seem to work. How to correct the error?
Hello Eyeman,
I don't even remember writing that, it's been so long ago - LOL!
I have since written a couple of alternative appointment calendar programs that I think (hope!) are an improvement (I just wanted something that was quick and easy to use and not weighed down with lots of features I didn't need).
I've attached the most recent one which may be of interest to you - I think it should be possible to use it as a 'front-end' to your specific requirements (in effect, replacing your A1_cal_date). Feel free to use/change/improve anything and if you have any questions, just let me know (for info', I use a 'bounce-bar' in this program so just take the cursor down to the bottom of the form to reveal the buttons).
Regards,
Derek.
My Visual Database → General → About annual calendar
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi