SShortSingh.
Back to feed

Developers urged to use shared date formatter instead of one-off toLocaleString calls

0
·5 views

A DEV Community post argues that formatting timestamps directly in components with toLocaleString or handmade ISO slices creates consistency bugs. Such ad-hoc formats can look right in one locale yet break in others, or disagree with the same timestamp shown elsewhere in an interface. The author recommends routing all date and time display through a repository's existing formatter, which already handles locale, time zone, and relative phrasing. Adding a new format should happen inside that formatter rather than in individual views. The post also includes review guidance, such as searching diffs for date-related calls and rejecting inline parsing or mixed formats on the same screen.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer moves two Next.js sites from Vercel to a single VPS after usage-limit outage

The author's two websites, devoun.com and a second site, went down with an error page after the hosting provider paused the account for exceeding usage limits. The code itself was fine, but the sites stayed offline until the account was paid up or the limit reset. To avoid that risk, the author migrated both sites in about a day to an existing VPS running Docker. The setup routes traffic through Traefik for HTTPS and redirects, an nginx cache for rendered pages and build files, and standalone Next.js containers. A systemd timer checks the repository every two minutes and redeploys on new commits, leaving the live site untouched if a build fails. The author suggests such self-hosting suits steady traffic and fixed costs, while managed platforms remain better for many teams, especially with spiky traffic.

0
ProgrammingDEV Community ·

Salesforce In-App Guidance Offers Training Inside the App to Boost User Adoption

Many Salesforce rollouts struggle not with configuration but with users failing to adopt the system after launch. In-App Guidance addresses this by placing prompts and walkthroughs directly on the pages where users do their work. Administrators can build these in Setup without writing code and control which users see them, on which pages, and for how long. The article recommends starting with one high-friction task, keeping walkthroughs short, and targeting them by profile and page. It also advises measuring completion rates and retiring prompts once the habit has formed, while warning against overuse and noting that edition and permission requirements apply.

0
ProgrammingDEV Community ·

Managing GBase 8a Schema Changes with Liquibase via the MySQL Driver

Liquibase is a tool for tracking and applying database schema and data changes using version numbers, comparisons, and rollbacks. Although no official adapter exists for GBase, the MySQL driver can be used to manage changes on a GBase 8a 9.5.3 cluster. The guide explains core concepts such as changesets identified by author and ID, changelog files, checksums that block edits to already-applied changes, and the DATABASECHANGELOG and DATABASECHANGELOGLOCK tracking tables. It then walks through installing Liquibase 4.30.0 on Red Hat or CentOS, initializing a project, and running updates against a cluster on port 5258. Finally, it shows how to add a GBase-specific distributed table definition in an SQL changelog using labels and contexts.