A Rails engine for cache-friendly, client-side local time rendering with JavaScript conversion.
Local Time is a Rails engine that helps developers display times and dates in users' local time zones efficiently. It solves the problem of timezone conversion by rendering times in UTC for caching and using JavaScript to convert them client-side, ensuring accurate local times without sacrificing performance.
Rails developers building applications that need to display times to users in different time zones, especially those concerned with caching performance and user experience.
Developers choose Local Time for its seamless integration with Rails, cache-friendly UTC rendering, and automatic client-side conversion, eliminating the need for complex server-side timezone logic while maintaining fast page loads.
Rails engine for cache-friendly, client-side local time
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Renders times in UTC within <time> elements, enabling efficient page caching and consistent server-side output, as highlighted in the README's focus on performance.
JavaScript instantly converts UTC times to the browser's local zone on load, ensuring accurate user displays without server-side timezone logic, simplifying development.
Provides Rails helpers like local_time, local_date, and local_time_ago for flexible formatting, including dynamic relative times that update every 60 seconds.
Includes default English translations and configurable 24-hour time formats, aiding internationalization and user preference handling with minimal setup.
The JavaScript strftime supports only a subset of directives (e.g., %a to %Z), limiting formatting options compared to Ruby's full capabilities, as admitted in the README.
Without JavaScript enabled, times display in UTC with no degradation to local times, potentially confusing users and requiring manual server-side alternatives.
Setup requires integration with importmaps or webpacker, adding complexity for legacy Rails applications or developers unfamiliar with these modern tools.