nexxtway/react-rainbow

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

Summary

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

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