DeutscheModelUnitedNations / munify-delegator

DELEGATOR registration app, part of MUN-Product Suite MUNify
GNU Affero General Public License v3.0
4 stars 3 forks source link

Date strings should have non-breaking spaces #91

Open Amselfass opened 4 days ago

Amselfass commented 4 days ago

When full dates in the 4. November 2024 format are shown to the user, the spaces should be replaced with   to avoid ugly line breaks within the date.

For example: https://github.com/DeutscheModelUnitedNations/munify-delegator/blob/e42634457dbe78f28f134a55c32c595472752c53/src/lib/components/ConferenceCard.svelte#L104C8-L104C8

TadeSF commented 4 days ago

Phew, is that even possible with toLocaleDateString() @m1212e? I mean you could just use replace() but you also would not want text breaking anywhere because the it runs out of space and you don't want overflow either... Maybe just solve it with ellipsis and no-wrap? Also not that safe of an option.

Maybe just replacing the first space with a   would be sufficient/a good solution? Or just not using long formats at all?

m1212e commented 3 days ago

Yes I think this would be more a CSS thing. Replacing Strings to adjust how the text is displayed isn't a good idea imo.