@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
|
|
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
|
|
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.
|
|
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.
|
|
24
|
-
"@consta/uikit": "^5.
|
|
25
|
-
"date-fns": "^
|
|
23
|
+
"@consta/icons": "^1.7.0",
|
|
24
|
+
"@consta/uikit": "^5.32.0",
|
|
25
|
+
"date-fns": "^4.1.0"
|
|
26
26
|
}
|
|
27
27
|
}
|