{"id":22065700,"url":"https://github.com/karenpayneoregon/time-combobox-vbnet","last_synced_at":"2025-03-23T18:17:13.786Z","repository":{"id":110840681,"uuid":"409024774","full_name":"karenpayneoregon/time-combobox-vbnet","owner":"karenpayneoregon","description":"Class project to work with time via a TimePickerComboBox","archived":false,"fork":false,"pushed_at":"2022-02-06T22:01:07.000Z","size":119,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T00:29:13.977Z","etag":null,"topics":["netcore5","vbnet"],"latest_commit_sha":null,"homepage":"","language":"Visual Basic .NET","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karenpayneoregon.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-09-22T01:20:43.000Z","updated_at":"2022-02-06T21:53:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"9cc5da4a-b7c4-4ed4-b92d-0c7d8e956f5a","html_url":"https://github.com/karenpayneoregon/time-combobox-vbnet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenpayneoregon%2Ftime-combobox-vbnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenpayneoregon%2Ftime-combobox-vbnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenpayneoregon%2Ftime-combobox-vbnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenpayneoregon%2Ftime-combobox-vbnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karenpayneoregon","download_url":"https://codeload.github.com/karenpayneoregon/time-combobox-vbnet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245144978,"owners_count":20568056,"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":["netcore5","vbnet"],"created_at":"2024-11-30T19:21:27.644Z","updated_at":"2025-03-23T18:17:13.755Z","avatar_url":"https://github.com/karenpayneoregon.png","language":"Visual Basic .NET","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TimePickerComboBox (VB.NET)\n\n.NET Framework has a `DateTimePicker` but not a control to work with `TimeSpan` which is what `TimePickerComboBox` was created for.\n\nTimePickerComboBox provides the ability to display time by hour, quarter hour or half-hour using an enum. \n\n- To manually set the time use [SetCurrentItem](https://github.com/karenpayneoregon/time-combobox-vbnet/blob/master/HoursLibrary/TimePickerComboBox.vb#L42) using a TimeSpan or using an overload for a string.\n- To get the current time as a TimeSpan use [TimeSpan](https://github.com/karenpayneoregon/time-combobox-vbnet/blob/master/HoursLibrary/TimePickerComboBox.vb#L82) property.\n- To get the current hour as an integer use [SelectedHour](https://github.com/karenpayneoregon/time-combobox-vbnet/blob/master/HoursLibrary/TimePickerComboBox.vb#L82) and [Minutes](https://github.com/karenpayneoregon/time-combobox-vbnet/blob/master/HoursLibrary/TimePickerComboBox.vb#L104) to get current minutes as an integer.\n- To determine if the current value is am or pm use [IsAm](https://github.com/karenpayneoregon/time-combobox-vbnet/blob/master/HoursLibrary/TimePickerComboBox.vb#L114) or [IsPm](https://github.com/karenpayneoregon/time-combobox-vbnet/blob/master/HoursLibrary/TimePickerComboBox.vb#L126)\n- To set the increment use [Increment](https://github.com/karenpayneoregon/time-combobox-vbnet/blob/master/HoursLibrary/TimePickerComboBox.vb#L139) property\n\n# Helpers\n\nThere are several language extensions to assist working with Date and TimeSpan types [found here](https://github.com/karenpayneoregon/time-combobox-vbnet/blob/master/LanguageExtensions.md).\n\n# SQL-Server example\n\nBefore running create the required database and tables using the following [script](https://github.com/karenpayneoregon/time-combobox-vbnet/blob/master/script.sql).\n\n# Hours class\n\nProvides the ability to create an `array of time` formatted `AM/PM` in hours e.g. `hh:mm tt`, quarter hour and half hour.\n\n\n# TimePickerComboBox\n\nA ComboBox which provides the ability to display hours based off `Hours` class.\n\n![img](assets/TimeComboBox.png)\n\n## Working with SQL-Server\n\nIn this code sample data is read from a SQL-Server database table where time columns are of type [time(7)](https://docs.microsoft.com/en-us/sql/t-sql/data-types/time-transact-sql?view=sql-server-ver15). \n\nA ListBox data source is set to a list of a model via a BindingSource then on position change the TimePickerComboBox is updated to the current item StartTime column value.\n\nOn selection change event of the TimePickerComboBox the StartTime value is updated in the data source.\n\nOther options would be data binding a property in the TimePickerComboBox.\n\n\n![img](assets/TimeTableDefinition.png)\n\n![img](assets/TimeTableQuery.png)\n\n![image](assets/TimeComboBoxData.png)\n\n# C# version\n\nSee the following `Microsoft TechNet article` [Working with SQL-Server time type in Windows forms](https://social.technet.microsoft.com/wiki/contents/articles/52218.c-working-with-sql-server-time-type-in-windows-forms.aspx)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarenpayneoregon%2Ftime-combobox-vbnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarenpayneoregon%2Ftime-combobox-vbnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarenpayneoregon%2Ftime-combobox-vbnet/lists"}