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

Ability to manipulate the text of the day so that only the first letter is capitalized #265

Closed
ysmike opened this issue Jan 29, 2021 · 4 comments · Fixed by #275
Closed

Comments

@ysmike
Copy link
Contributor

ysmike commented Jan 29, 2021

Changing the text format of the day from all uppercase to all lowercase (e.g. TUE --> tue) can be done by setting the prop: dateNameStyle={{ textTransform: 'lowercase' }}

However, if I'd like only the first letter capitalized, I'm not sure if there is a workaround for this since I cannot use pseudo elements (e.g. ::first-letter). Does anyone how this might be done?

@peacechen
Copy link
Collaborator

The localization props allow you to customize any of the date strings.
https://github.com/BugiDev/react-native-calendar-strip#localization

@ysmike
Copy link
Contributor Author

ysmike commented Feb 1, 2021

I set the weekdaysShort prop in the locale object to all lowercase but the calendar strip component is still rendering them in all caps. Is there anywhere else I can look to solve this issue?

I also noticed that moment.weeksdaysShort() does not return days in all uppercase:[ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ]

@peacechen
Copy link
Collaborator

You're right, the day component changes it to uppercase 😮

{date.format("ddd").toUpperCase()}

Apologies for not catching that. We'll need to add a prop to control whether it does an uppercase on the day names. Would you mind submitting a PR with a new prop upperCaseDays (default to true)?

@peacechen
Copy link
Collaborator

PR merged and published in 2.1.9

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

Successfully merging a pull request may close this issue.

2 participants