Skip to content

Conversation

@private-yusuke
Copy link
Contributor

This PR adds Calendar, a component inheriting QCalendarWidget.

Example

import{DateFormat,DayOfWeek,NativeElement,QCalendarWidgetSignals,QDate,}from"@nodegui/nodegui";import{Calendar,Renderer,useEventHandler,Window,}from"@nodegui/react-nodegui";importReactfrom"react";constApp=()=>{constcalendarClickHandler=useEventHandler<QCalendarWidgetSignals>({activated: (nativeDate)=>{constdate=newQDate(nativeDateasunknownasNativeElement);console.log(`activated: ${date.toString(DateFormat.SystemLocaleDate)}`);},clicked: (nativeDate)=>{constdate=newQDate(nativeDateasunknownasNativeElement);console.log(`clicked: ${date.toString(DateFormat.SystemLocaleDate)}`);},currentPageChanged: (year,month)=>{console.log(`currentPageChanged: year, month: ${year}, ${month}`);},selectionChanged: ()=>{console.log("selectionChanged");},},[]);return(<Window><CalendarfirstDayOfWeek={DayOfWeek.Sunday}on={calendarClickHandler}/></Window>);};Renderer.render(<App/>);

@a7ula7ul merged commit 2e6ac23 into nodegui:masterJul 7, 2022
@private-yusukeprivate-yusuke deleted the add-calendar branch July 7, 2022 10:24
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@private-yusuke@a7ul