@autobusal/utilities 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/date.tsx CHANGED
@@ -19,12 +19,12 @@ export const getFormattedShort = (date: Date, t: TFunction<'generate'>): string
19
19
  const weekday = date.toLocaleString('default', { weekday: 'short' });
20
20
 
21
21
  const display = {
22
- weekday: `general:date.days.${ weekday.toLowerCase() }`,
22
+ weekday: `data.days.${ weekday.toLowerCase() }`,
23
23
  day: day < 10 ? `0${ day }` : day,
24
- month: `general:date.months.${ month.toLowerCase() }`
24
+ month: `data.months.${ month.toLowerCase() }`
25
25
  };
26
26
 
27
- return `${ t(display.weekday) }, ${ display.day } ${ t(display.month).substring(0, 3) }`;
27
+ return `${ t(display.weekday, { ns: 'common' }) }, ${ display.day } ${ t(display.month, { ns: 'common' }).substring(0, 3) }`;
28
28
  };
29
29
 
30
30
  export const differenceYears = (date: Date): number => {
package/index.ts CHANGED
@@ -2,6 +2,7 @@ import { createDate, prepareDate, getFormattedShort, differenceYears, futureDate
2
2
  import { validate, display } from './form';
3
3
  import getPosition from './map';
4
4
  import { error, notify, success } from './notify';
5
+ import { getSex } from './passengers';
5
6
 
6
7
  export {
7
8
  validate,
@@ -14,5 +15,6 @@ export {
14
15
  prepareDate,
15
16
  getFormattedShort,
16
17
  differenceYears,
17
- futureDate
18
+ futureDate,
19
+ getSex
18
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/utilities",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "type": "module",
5
5
  "main": "index.ts"
6
6
  }
package/passengers.ts ADDED
@@ -0,0 +1,3 @@
1
+ export const getSex = (value: number): string => (
2
+ value === 1 ? 'female' : 'male'
3
+ );