feat: Show next available day/hour and minutes on widget (#6902)
* feat: Show next available hour and minutes on widget * chore: Adds spec * chore: Show days * chore: Code clean up * chore: Review fixes * chore: Minor fixes * chore: Review suggestion fixes * chore: Minor fixes * Added timezone to widget payload * chore: Adds time zone * chore: Review fixes * chore: Adds comments * chore: Rounded up min with nearest multiple of 5 * chore: Review fixes * chore: Review fixes * chore: Review fixes * chore: Review fixes * chore: Fix specs * chore: Review fixes * chore: Fix specs * chore: Review fixes * chore: Moved day names to i18n * chore: Review fixes * chore: Fix specs --------- Co-authored-by: Tejaswini Chile <tejaswini@chatwoot.com> Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com> Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
This commit is contained in:
@@ -30,3 +30,10 @@ export const isTimeAfter = (h1, m1, h2, m2) => {
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
export const generateRelativeTime = (value, unit, languageCode) => {
|
||||
const rtf = new Intl.RelativeTimeFormat(languageCode, {
|
||||
numeric: 'auto',
|
||||
});
|
||||
return rtf.format(value, unit);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user