Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add map month name #12

Open
AndroidLab opened this issue Jun 26, 2024 · 4 comments
Open

Add map month name #12

AndroidLab opened this issue Jun 26, 2024 · 4 comments

Comments

@AndroidLab
Copy link

AndroidLab commented Jun 26, 2024

Is it possible to add a custom option to set the name of the month?

@Composable
fun WheelDatePicker(
...
  selectorProperties: SelectorProperties = WheelPickerDefaults.selectorProperties(),
  onMapMonthName: (name: String) -> String = { it },
  onSnappedDate: (snappedDate: LocalDate) -> Unit = {}
) 
@Composable
internal fun DefaultWheelDatePicker(
...
  selectorProperties: SelectorProperties = WheelPickerDefaults.selectorProperties(),
  onMapMonthName: (name: String) -> String = { it },
  onSnappedDate: (snappedDate: SnappedDate) -> Int? = { _ -> null }
) {
  ...
  val months = (1..12).map {
    val monthName = onMapMonthName(
        Month(it).name.lowercase().replaceFirstChar { char -> char.titlecase() }
    )
...
}

@darkokoa
Copy link
Owner

This looks good, worth considering.

@ashaluwalakazeem
Copy link

I would like to use this feature. How soon can we have it?
I'm willing to contribute to this feature.

@darkokoa
Copy link
Owner

darkokoa commented Dec 21, 2024

Hi @ashaluwalakazeem , i18n is under development, and an alpha version will be available for use by the end of this month. Of course, this version may not be particularly good. If you have better implementation ideas, we can discuss them and your contributions are also welcome!

ashaluwalakazeem added a commit to ashaluwalakazeem/compose-datetime-wheel-picker that referenced this issue Dec 22, 2024
@ashaluwalakazeem
Copy link

Hi @darkokoa , kindly review the PR. I really need this feature on the ticket on I'm working on.
Thanks.

By the way, this is my first contribution on a KMP (CMP) project 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants