nexxtway/react-rainbow

View on GitHub
src/components/WeeklyCalendar/header/hooks/useFormattedNumberDay.js

Summary

Maintainability
A
40 mins
Test Coverage
import { useCallback } from 'react';

export default function useFormattedNumberDay(locale) {
    return useCallback(
        day =>
            new Intl.DateTimeFormat(locale, {
                day: 'numeric',
            }).format(day),
        [locale],
    );
}