[F/OS] Wheel Calendar & Spin Calendar Extension

Wheel Calendar Extension

Description:

I am thrilled to bring the Wheel Calendar Picker to the MIT App Inventor community, a feature I was eager to utilize in my own apps. After much effort, I’m excited to share this customizable and interactive calendar picker that will help you easily integrate a wheel-based calendar into your app. Whether you're building a scheduling app, a form, or anything that requires date selection, the Wheel Calendar Picker offers a user-friendly interface to pick dates with ease..It is a versatile and customizable extension for MIT App Inventor that allows you to integrate a wheel-based calendar picker in your app. It enables users to easily select a day, month, and year with a smooth and intuitive scrollable interface. Perfect for apps that require date selection functionality, the extension is highly flexible and easy to use, with full control over the visual appearance and behavior of the calendar.

Key Features:

  • Customizable Background Color: Set a background color that matches the design of your app, providing a personalized touch.
  • Font Size Adjustment: Modify the font size to match your layout and design needs.
  • Customizable Year Range: Define a specific year range for the picker, which is ideal for apps with date constraints.
  • Date Selection: Users can easily select a day, month, and year, and the picker will automatically update the selected date.
  • Automatic Text Color: The text color adjusts automatically when the background color is set to dark, ensuring optimal readability.
  • Event Handling: Trigger events when the date is changed, allowing developers to respond dynamically to user input.

Blocks Overview:

The Wheel Calendar Picker extension offers several blocks that allow developers to interact with and customize the calendar picker. Here is a breakdown of the available blocks and their functionality:

  1. InitializeIn (Procedure)
  • Purpose: Initializes the calendar picker and adds it to an arrangement in your app.
  • Input:
    • hVArrangement: The arrangement (container) where the calendar picker will be placed.
  • Output: None (void procedure).
  • Usage: This block must be used to initialize the picker in an arrangement, setting it up for use in your app.
  1. SetBackgroundColor (Function)
  • Purpose: Sets the background color of the calendar picker.
  • Input:
    • Color: A color value (e.g., 0xFFFFFFFF for white, 0xFF000000 for black).
  • Output: None (void procedure).
  • Usage: Use this block to change the background color of the calendar picker to match your app's design.
  1. SetFontSize (Function)
  • Purpose: Sets the font size for the text within the calendar picker.
  • Input:
    • Size: An integer value representing the font size (e.g., 20 for font size 20).
  • Output: None (void procedure).
  • Usage: Use this block to modify the font size of the day, month, and year text.
  1. SetYearRange (Function)
  • Purpose: Sets the range of years available for selection in the calendar picker.
  • Input:
    • StartYear: The starting year (e.g., 1900).
    • EndYear: The ending year (e.g., 2100).
  • Output: None (void procedure).
  • Usage: Use this block to define the minimum and maximum years users can select.
  1. AfterDateChanged (Event)
  • Purpose: This event is triggered whenever the user changes the selected date (day, month, or year) using the picker.
  • Inputs:
    • TimeInMillis: The date in milliseconds (long value).
    • FormattedDate: The selected date formatted as a string in dd/MM/yyyy format.
    • DayOfWeek: The day of the week (e.g., "Monday", "Tuesday").
    • FirstDayOfMonth: The first day of the selected month (e.g., "Monday").
    • LastDayOfWeek: The last day of the selected month (e.g., "Sunday").
    • LastDay: The total number of days in the selected month (e.g., 28, 29, 30, or 31).
  • Usage: This event provides all the necessary information about the updated date. You can use it to trigger further actions, such as updating other parts of your app based on the selected date.

Available Blocks

Blocks Setup

Output


Extension
Version 1: WheelCalendarV1.0.aix (14.1 KB) 2025-03-18T18:30:00Z
Version 2: Destroyed
Version 3: SpinCalendarV3.aix (12.7 KB) 2025-03-21T18:30:00Z

Spin Calendar Images:



ageDiff will give the users age compare with current date, Also it will alert you how many days is there yet to attain his next birthday

Published on :
V1: 2025-03-18T18:30:00Z
V2: N/A
V3: 2025-03-21T18:30:00Z

Please test this Very Simple Extension and share your valuable feedback.
Extension created by using Niotron IDE and no external lib are used.

Views are welcome for any updation.

Thanks a lot

3 Likes

Looks similar to this:

Yours is different, mine is different. I was trying it for last few months and unable to solve while setting the font colour. My previous code throws error so i took time. Few days back when i see your code i was surprised but i was convinced that youra is different.

It's not mine :man_shrugging:t2:

I just shared since I found it similar. Anyway you can also show it in a dialog.

1 Like

May be . me too felt the same when i see your extenion. i wa thinking to give the sm for lat few month so stated to write code one after another but tarted to compiled and teted from mar 14th onwards. see this.

i hope no one can edit the time it wa added in the IDE in the niotron extension.

2 Likes

Version 3 added : Ref ==> First Post

SpinCalendarV3.aix (12.7 KB)


2 Likes

I like this calendar, good work :100:

1 Like

One more speciality of this spin calendar is either you can use custom HA or it will create dynamically at the end of existing native components visible in the screen..

Default year has been added (1900 to 2100)
In next version just like V1 it will be given to user preference for startYear and endYear

This looks good. Got me to thinking if it is possible to "generalise" a fork of this extension, so that one could provide the "spinner" with a list of items, instead of calendar items ?

Like this?
https://wangsk789.github.io/wheelview/

1 Like

Yea definitely it is possible. We can customize anything to come as list of itema in the spinner. I just use very basic simple code to generate numbers between 1 to 31 and 1900 to 2100.

Looks to be already done, had forgotten about @Kevinkun 's extension :frowning:

Yea he already provided. And i had the feeling to give it in one row. But the wheel i am unable to do in java but react code it was easy to make. So i changed the design in v3 to give the calendar items in a single row and upon click it will give you list of items like number picker with all the needy items in OnDateChanged event listener. Still thinking what other forms can i make the calender to give.

Expectation : Upcoming version will support inbuild tinydb so user can store, retrieve notes. Existing infor will display on another vertical Arrangement without need of any other components

Upcoming features in Version 04 - JsrCalendar

  • Populates the monthly calender on a given HA or VA only by dynamically.
  • Enabled save event
  • Enabled to retrieve the saved events
  • Enabled to show the list of events saved on a particular day in listview
  • Enabled to edit the saved event
  • Enabled to update the event as well as nth item of the event
  • Enabled to show previous/next month calender by swipe as well as button click
  • Present day shows by blue bg
  • Clicked date will be distinguished by another bg color
  • Single click to see the saved events
  • Long click to save event
  • No complex codes/library used.

After the backtest will be relased

1 Like

where the version 4.0?

Hmmm. People's showed less interest so do not work on it. May be they are achieving the above with default blocks.

If you build it, they will come :wink:

2 Likes

can you share version 4?

Version 4

jsr.spincalendar.aix (34.4 KB)

SpinCalendar V4.0 Extension - Description for Users

SpinCalendar is a powerful and customizable date picker with event management capabilities for your App Inventor apps. Unlike traditional calendars, it uses intuitive spinner controls for quick date selection - simply spin through days, months, and years. You can save events with flexible recurrence options like "every Monday to Friday for 3 months" or "every weekend forever", customize colors and text sizes, and navigate easily between months and years. All events are automatically saved and persist between app sessions. Perfect for building appointment schedulers, reminder apps, task managers, or any app that needs date-based event tracking with complex recurrence patterns!

:counterclockwise_arrows_button: SaveEventWithRecurrence - Complete Reference

Parameters Table

Parameter Type Required Description Examples
event Text Yes The event description "Team Meeting", "Birthday"
daysPattern Text Yes* Days to repeat (*can be empty for daily/yearly) "Mon,Wed,Fri", "Mon-Fri", "15", ""
repeatType Text Yes How often to repeat "daily", "weekly", "monthly", "yearly"
duration Number Yes How long to repeat (0 = forever) 3, 6, 12, 0
durationUnit Text Yes Unit of duration "days", "weeks", "months", "years", "forever"

DaysPattern Formats

Format Meaning Example Usage
"Mon" Single day Every Monday
"Mon,Wed,Fri" Specific days Monday, Wednesday, Friday
"Mon-Fri" Range Monday through Friday
"Sat,Sun" Weekend Saturday and Sunday
"15" Day of month 15th of each month
"" (empty) Not needed For daily or yearly recurrence

RepeatType Options

Value Meaning Used With
"daily" Every day daysPattern can be empty
"weekly" Specific weekdays daysPattern required
"monthly" Specific day of month daysPattern = day number (e.g., "15")
"yearly" Same date every year daysPattern can be empty

DurationUnit Options

Value Meaning Example
"days" Repeat for X days duration: 10, unit: "days"
"weeks" Repeat for X weeks duration: 4, unit: "weeks"
"months" Repeat for X months duration: 3, unit: "months"
"years" Repeat for X years duration: 1, unit: "years"
"forever" Never stop duration: 0, unit: "forever"

:memo: Usage Examples Table

Scenario Event Text Days Pattern Repeat Type Duration Duration Unit
Work days for 3 months "Office Work" "Mon-Fri" "weekly" 3 "months"
Weekends for 2 months "Family Time" "Sat,Sun" "weekly" 2 "months"
Birthday forever "John's Birthday" "" "yearly" 0 "forever"
Gym twice weekly for 4 weeks "Gym" "Tue,Thu" "weekly" 4 "weeks"
Bill payment for 6 months "Electric Bill" "15" "monthly" 6 "months"
Daily medicine for 10 days "Medicine" "" "daily" 10 "days"
Team meeting forever "Standup" "Mon" "weekly" 0 "forever"
Classes for 1 year "Yoga Class" "Wed,Fri" "weekly" 1 "years"
Weekend getaway for 3 months "Trip Planning" "Sat" "weekly" 3 "months"
Monthly review for 12 months "Review" "1" "monthly" 12 "months"

:date: Events (Triggered by Calendar)

Event Parameters Description
DateChanged date (text), eventCount (number), millis (number), isLeapYear (boolean) Fires when selected date changes
EventClicked date (text), event (text), index (number) Fires when an event is clicked
EventSaved date (text), event (text), recurrence (text), totalEventsForDate (number) Fires when event is saved
EventDeleted date (text), event (text), recurrence (text) Fires when event is deleted
EventsCleared date (text) Fires when all events for a date are cleared
AllEventsCleared none Fires when all events are cleared

:light_bulb: Quick Start Guide

Step 1: Add to Layout

blocks

call SpinCalendar1.SetArrangement component: HorizontalArrangement1

Step 2: Customize Appearance (Optional)

blocks

set SpinCalendar1.SpinnerTextColor to color blue set SpinCalendar1.EventTextSize to 16

Step 3: Save Events

blocks

// Simple event call SpinCalendar1.SaveEventCurrent "Meeting" // Recurring event - Every Mon-Fri for 3 months call SpinCalendar1.SaveEventWithRecurrence event: "Work" daysPattern: "Mon-Fri" repeatType: "weekly" duration: 3 durationUnit: "months"

Step 4: Handle Events

blocks

when SpinCalendar1.EventClicked date event index do // Show clicked event


:wrench: Notes & Tips

  1. Index values in DeleteEvent are 1-based (first event = index 1)
  2. Date format uses Java SimpleDateFormat patterns
  3. Colors can be set using color blocks or hex values
  4. Empty daysPattern is acceptable for daily and yearly recurrence
  5. Duration 0 + "forever" means never-ending recurrence
  6. Week numbers follow ISO 8601 standard
  7. Events persist automatically when AutoSave is enabled

SoureCode