@consta/header 3.1.0 → 3.2.0

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.
@@ -1,2 +1,2 @@
1
- import format from"date-fns/format";import formatDistanceToNow from"date-fns/formatDistanceToNow";import ruLocale from"date-fns/locale/ru";export const defaultDateFormat=a=>{const b=new Date;return 36e5>b.getTime()-a.getTime()?formatDistanceToNow(a,{locale:ruLocale,addSuffix:!0}):format(b,"dd.MM.yyyy")===format(a,"dd.MM.yyyy")?format(a,"HH:mm"):format(a,"dd.MM.yyyy HH:mm")};
1
+ import{format,formatDistanceToNow}from"date-fns";import{ru as ruLocale}from"date-fns/locale";export const defaultDateFormat=a=>{const b=new Date;return 36e5>b.getTime()-a.getTime()?formatDistanceToNow(a,{locale:ruLocale,addSuffix:!0}):format(b,"dd.MM.yyyy")===format(a,"dd.MM.yyyy")?format(a,"HH:mm"):format(a,"dd.MM.yyyy HH:mm")};
2
2
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":["format","formatDistanceToNow","ruLocale","defaultDateFormat","date","currentDate","Date","getTime","locale","addSuffix"],"sources":["../../../../../../src/components/Notifications/NotificationsItemFooter/helpers.ts"],"sourcesContent":["import format from 'date-fns/format';\nimport formatDistanceToNow from 'date-fns/formatDistanceToNow';\nimport ruLocale from 'date-fns/locale/ru';\n\nexport const defaultDateFormat = (date: Date): string => {\n const currentDate = new Date();\n\n if (currentDate.getTime() - date.getTime() < 3600000) {\n return formatDistanceToNow(date, { locale: ruLocale, addSuffix: true });\n }\n\n if (format(currentDate, 'dd.MM.yyyy') === format(date, 'dd.MM.yyyy')) {\n return format(date, 'HH:mm');\n }\n\n return format(date, 'dd.MM.yyyy HH:mm');\n};\n"],"mappings":"AAAA,MAAO,CAAAA,MAAM,KAAM,iBAAiB,CACpC,MAAO,CAAAC,mBAAmB,KAAM,8BAA8B,CAC9D,MAAO,CAAAC,QAAQ,KAAM,oBAAoB,CAEzC,MAAO,MAAM,CAAAC,iBAAiB,CAAIC,CAAU,EAAa,CACvD,KAAM,CAAAC,CAAW,CAAG,GAAI,CAAAC,IAAM,CAAC,MAEc,KAAO,CAAhDD,CAAW,CAACE,OAAO,CAAC,CAAC,CAAGH,CAAI,CAACG,OAAO,CAAC,CAAW,CAC3CN,mBAAmB,CAACG,CAAI,CAAE,CAAEI,MAAM,CAAEN,QAAQ,CAAEO,SAAS,GAAO,CAAC,CAAC,CAGrET,MAAM,CAACK,CAAW,CAAE,YAAY,CAAC,GAAKL,MAAM,CAACI,CAAI,CAAE,YAAY,CAAC,CAC3DJ,MAAM,CAACI,CAAI,CAAE,OAAO,CAAC,CAGvBJ,MAAM,CAACI,CAAI,CAAE,kBAAkB,CACxC,CAAC"}
1
+ {"version":3,"file":"helpers.js","names":["format","formatDistanceToNow","ru","ruLocale","defaultDateFormat","date","currentDate","Date","getTime","locale","addSuffix"],"sources":["../../../../../../src/components/Notifications/NotificationsItemFooter/helpers.ts"],"sourcesContent":["import { format, formatDistanceToNow } from 'date-fns';\nimport { ru as ruLocale } from 'date-fns/locale';\n\nexport const defaultDateFormat = (date: Date): string => {\n const currentDate = new Date();\n\n if (currentDate.getTime() - date.getTime() < 3600000) {\n return formatDistanceToNow(date, { locale: ruLocale, addSuffix: true });\n }\n\n if (format(currentDate, 'dd.MM.yyyy') === format(date, 'dd.MM.yyyy')) {\n return format(date, 'HH:mm');\n }\n\n return format(date, 'dd.MM.yyyy HH:mm');\n};\n"],"mappings":"AAAA,OAASA,MAAM,CAAEC,mBAAmB,KAAQ,UAAU,CACtD,OAASC,EAAE,GAAI,CAAAC,QAAQ,KAAQ,iBAAiB,CAEhD,MAAO,MAAM,CAAAC,iBAAiB,CAAIC,CAAU,EAAa,CACvD,KAAM,CAAAC,CAAW,CAAG,GAAI,CAAAC,IAAM,CAAC,MAEc,KAAO,CAAhDD,CAAW,CAACE,OAAO,CAAC,CAAC,CAAGH,CAAI,CAACG,OAAO,CAAC,CAAW,CAC3CP,mBAAmB,CAACI,CAAI,CAAE,CAAEI,MAAM,CAAEN,QAAQ,CAAEO,SAAS,GAAO,CAAC,CAAC,CAGrEV,MAAM,CAACM,CAAW,CAAE,YAAY,CAAC,GAAKN,MAAM,CAACK,CAAI,CAAE,YAAY,CAAC,CAC3DL,MAAM,CAACK,CAAI,CAAE,OAAO,CAAC,CAGvBL,MAAM,CAACK,CAAI,CAAE,kBAAkB,CACxC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/header",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "files": [
5
5
  "*",
6
6
  "!**/__mocks__",
@@ -20,8 +20,8 @@
20
20
  "peerDependencies": {
21
21
  "@bem-react/classname": "^1.6.0",
22
22
  "@bem-react/classnames": "^1.3.10",
23
- "@consta/icons": "^1.5.0",
24
- "@consta/uikit": "^5.28.1",
25
- "date-fns": "^2.30.0"
23
+ "@consta/icons": "^1.7.0",
24
+ "@consta/uikit": "^5.32.0",
25
+ "date-fns": "^4.1.0"
26
26
  }
27
27
  }