Fixing my customized calendar

Hi :slight_smile:
After studying ABG's solution (How can I create data storage using clock component? - #57 by ABG) I created my customized calendar.

Nadi_08.aia (975.4 KB)

I still have to set: month changing, highlighting days with data, clicking buttons, etc. I've worked on it, but I have found problems that I don't know how to solve, so I need your help.

So my first question is:
How can I disable the datepicker popup dialog that starts automatically?

Thank You :cherry_blossom:

From your video, it looks like you don't want your date picker component to act like a date picker.

You have your own calendar setup instead.

So why not just substitute a Button showing the selected date instead of a Date Picker?
Trigger your custom calendar action from the new DatePickerButton.Click event.

Really? Can I replace it completely? ...also for surfing in the table or just for the calendar?
...I will still have to match the data in the table with the days with the data to click.

Do I need to keep the datepicker "not visible" to set the date in the button text?
It is not very clear to me how to do it.

There's a saying among coders

If in doubt
rip it out

(My dentist does that too, but I would not recommend it to surgeons.)

The date picker is used to pick dates. Nothing more. It can hold the selected date, but so can a global variable, like the custom button calendar you went to all that trouble to add.

Knowing when to let go of something is just as important as knowing how to add things.

3 Likes I will work on it tomorrow.

In the meantime my next question is:
How to show the first day of month in the calendar? ...right now the month starts from the second day. If I set "MakeInstantFromParts" on day "0" it works, but obviously it shows also an error.

Check up this post for this question

Thanks Spicy for your suggestion :slight_smile: ...but it doesn't respond to my requests, as I don't use extensions.
Anyway, it can be useful to someone else.

So I keep waiting for the answer to my previous question.

The first day of the month is the day in this month whose day number is 1.

If you are displaying the day number in each button of that calendar, just loop through them, testing each .Text value against 1.

Is that what you wanted?

P.S. in my rectangular month display, it was necessary to include prior month days to fill out the first week, since I was displaying complete weeks.

Is the weekday vs weekend nature of each date not important to you?

Great! I am finally free from the DatePicker

...not sure if my question was clear
I'm just not able to display the day "1" in my calendar (as you see in my video).
I think the problem is that "Add days" is adding days starting from the instant "day 1" so days starts from "2".

If I set the day on instant "0" it works and I can see all days of month, included "1", but it shows the Error that the similar date doesn't exist.
I really don't how to fix it.

The off-by-1 error might be from confusing an offset with an index.

Your quantity in the Clock.Add Days block could be changed to (index_day_button - 1) as a minimal tweak to lower your date range by a day.

Alleluia! It works.

Schermata 2022-08-10 alle 15.18.37

how can I change month days in my calendar while clicking arrows of DateButton?

You need a global variable (Calendar_Base_Instant?) for the year and month currently being displayed.

I see you were pulling those from Clock.Now in your last blocks image.

If you use an Instant for your global variable (Initialized to Now() at startup), you can use the Clock block AddMonth (+1 or -1) to adjust the global variable before refreshing your calendar display from the variable.


This is not accepted:

You can ref this guide to know how to get first day of every month without extension

You can't use these blocks in the initialization part. use it like this:


This should work.

init the variable to something like '' or 0, then in Screen.Initialize set it to Clock.Now

Do NOT set it to a year if you are keeping it as an Instant.

Also, you can see what kind of error is given by clicking on the red 'x', for example:


Hi Yoshi :slight_smile:
Thanks to your suggestion, confirmed by Abraham, I was able to apply Abraham's solution: Fixing my customized calendar - #12 by ABG

So now browsing through the months of my calendar is fixed. Great!
These are my new blocks:

Nadi_09.aia (974.4 KB)

If there is any correction or improvement to be made, please tell me
...otherwise my next question is:

I have to set up an image for each day that contains the data.
How can I recall the Namespace? you see in my blocks in the "Settings_Day_buttons" procedure I tried to do it, can I do it?

ps: for now I have disconnected image setting for Sunday, I will put it back once buttons with data are fixed

...ah, the Namespace is called: