{"id":27644962,"url":"https://github.com/ldgrp/brick-calendar","last_synced_at":"2025-04-24T00:59:20.033Z","repository":{"id":289248744,"uuid":"970071275","full_name":"ldgrp/brick-calendar","owner":"ldgrp","description":"Calendar widget for the Brick TUI library","archived":false,"fork":false,"pushed_at":"2025-04-23T12:13:38.000Z","size":128,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T00:59:16.016Z","etag":null,"topics":["brick","calendar","haskell","terminal","terminal-based","tui","widget"],"latest_commit_sha":null,"homepage":"https://hackage.haskell.org/package/brick-calendar","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ldgrp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-21T12:21:42.000Z","updated_at":"2025-04-23T12:13:10.000Z","dependencies_parsed_at":"2025-04-22T10:56:16.742Z","dependency_job_id":"e5e4a448-1075-4392-89f9-b3a2a39f9d4d","html_url":"https://github.com/ldgrp/brick-calendar","commit_stats":null,"previous_names":["ldgrp/brick-calendar"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldgrp%2Fbrick-calendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldgrp%2Fbrick-calendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldgrp%2Fbrick-calendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldgrp%2Fbrick-calendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ldgrp","download_url":"https://codeload.github.com/ldgrp/brick-calendar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250540987,"owners_count":21447427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brick","calendar","haskell","terminal","terminal-based","tui","widget"],"created_at":"2025-04-24T00:59:19.510Z","updated_at":"2025-04-24T00:59:20.025Z","avatar_url":"https://github.com/ldgrp.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brick Calendar\n\n![A screenshot of the brick calendar widget](./docs/image.png)\n\nA calendar widget for [Brick](https://github.com/jtdaugherty/brick) terminal user interfaces.\n\n## Features\n\n- Configurable first day of week (Sunday, Monday, etc.)\n- Configurable day-of-week label\n  - Single char (S, M, T, W, T, F, S)\n  - Double char (Su, Mo, Tu, We, Th, Fr, Sa)\n  - Distinct initials (Su, M, T, W, Th, F, S)\n  - Hidden\n- Option to show/hide/dim days outside the current month\n- Easy integration with existing Brick applications\n\n## Installation\n\n```\ncabal install brick-calendar\n```\n\n## Usage\n\n```haskell\n-- Define a resource name type\ndata AppName = CalName CalendarResource\n  deriving (Show, Eq, Ord)\n\n-- Create a calendar state from a date\nmkCalendarState :: Day -\u003e CalendarState AppName\nmkCalendarState day = \n  let (year, month, _) = toGregorian day\n      config = defaultCalendarConfig\n                { _weekStart = Monday\n                , _dayLabelStyle = DistinctInitials\n                , _showDayLabels = True\n                , _outsideMonthDisplay = ShowDimmed\n                }\n  in CalendarState year month (Just day) config CalName\n\n-- Render the calendar\ndrawUI :: AppState -\u003e [Widget AppName]\ndrawUI s = [center $ border $ padAll 1 $ renderCalendar (calendar s)]\n\n-- Handle calendar navigation events\nhandleEvent :: BrickEvent AppName e -\u003e EventM AppName AppState ()\nhandleEvent (VtyEvent (V.EvKey V.KEsc [])) = halt\nhandleEvent e = \n  zoom calendarL $ handleCalendarEvent e\n```\n\nSee `programs/SimpleDemo.hs` for a complete working example.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldgrp%2Fbrick-calendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fldgrp%2Fbrick-calendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldgrp%2Fbrick-calendar/lists"}