Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Localization with JavaScript Intl: Turkish Sorting with Collator, PluralRules, ListFormat, Segmenter, DisplayNames and DurationFormat
Use Intl.Collator("tr") for Turkish sorting, PluralRules for singular/plural text, ListFormat for "Dune, Emma, and The Hobbit", Segmenter for character limits in reviews with emoji and DurationFormat for reading time. With Bookstore examples we show each one, the browser differences and why caching instances matters, with real output.
Advanced Date Handling in JavaScript: Time Zones, UTC and Formatting with Intl
We see that Date holds a single moment, then cover UTC and ISO 8601 rules, Intl.DateTimeFormat options, "3 days ago" with Intl.RelativeTimeFormat, the daylight saving trap and a first look at Temporal.
JavaScript Date Basics: Creating, Calculating and Formatting Dates
We see that a Date is really a timestamp, then learn how to create dates, the zero-based month trap, get/set methods, the difference between two dates and formatting with toLocaleDateString and Intl.DateTimeFormat.
JavaScript Number and Math: 0.1 + 0.2, Number Conversion, Random Numbers and Formatting
We learn JavaScript's single number type, the 0.1 + 0.2 precision issue, Number vs parseInt, NaN and bigint, rounding and random numbers with Math, and currency formatting with Intl.NumberFormat.