-
I haven't been able to figure out how I can use this library to give the user the option to only select the month and year. I need this as an input for a month report screen. When the user clicks on the calendar icon, days of the month should not show up, but instead the user should only be able to select month and year and then once that is set, only month and year should be displayed in the text box. For example, 'January, 2024'. How do I use this library to make this functionality? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello Darryl, This is a use case that I don't think was ever considered when the LGoodDatePicker library was written. So I don't think it exists. It might be possible for an interested programmer to add it to the library, but I don't think I would recommend it. It's kind of outside of the scope of what the library was written for. This library is intended to give a LocalDate as the final data result, and not a YearMonth variable. So it seems to me that it might be an almost unrelated usage. If I needed that functionality, I might implement it something like this. I would create a drop-down with all 12 months on it. And I would either create a second drop-down to the right with nearby years, maybe plus or minus 30 years from the current year or however much range you need... Or create a text box that only accepts digits. And perhaps put an optional little submit button on the right to let the user indicate that they are done making their selection. You can also do input verification to ensure that it is a valid four digit year that the user enters. An approach like that might get the job done. Best of luck with your needs. |
Beta Was this translation helpful? Give feedback.
Hello Darryl, This is a use case that I don't think was ever considered when the LGoodDatePicker library was written. So I don't think it exists. It might be possible for an interested programmer to add it to the library, but I don't think I would recommend it. It's kind of outside of the scope of what the library was written for. This library is intended to give a LocalDate as the final data result, and not a YearMonth variable. So it seems to me that it might be an almost unrelated usage.
If I needed that functionality, I might implement it something like this. I would create a drop-down with all 12 months on it. And I would either create a second drop-down to the right with nearby year…