Joined: {{formatRelativeDate @user.createdAt}}
``` ```glimmer-js // app/components/post-card.gjs import { formatRelativeDate } from '../utils/format-relative-date';Posted: {{formatRelativeDate @post.createdAt}}
``` **For helpers with state, use class-based helpers:** ```javascript // app/utils/helpers/format-currency.js export class FormatCurrencyHelper { constructor(owner) { this.intl = owner.lookup('service:intl'); } compute(amount, { currency = 'USD' } = {}) { return this.intl.formatNumber(amount, { style: 'currency', currency, }); } } ``` **Common helpers to create:** - Date/time formatting - Number formatting - String manipulation - Array operations - Conditional logic Helpers promote code reuse, are easier to test, and keep components focused on behavior. Reference: [Ember Helpers](https://guides.emberjs.com/release/components/helper-functions/)