File tree Expand file tree Collapse file tree
src/renderer/components/snippets Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838 "@vueuse/core" : " ^8.1.2" ,
3939 "ace-builds" : " ^1.4.14" ,
4040 "axios" : " ^0.26.1" ,
41+ "date-fns" : " ^2.28.0" ,
4142 "electron-store" : " ^8.0.1" ,
4243 "fs-extra" : " ^10.0.1" ,
4344 "highlight.js" : " ^11.5.1" ,
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ import { onClickOutside } from '@vueuse/core'
4343import { computed , ref } from ' vue'
4444import type { SystemFolderAlias } from ' @shared/types/renderer/sidebar'
4545import { useTagStore } from ' @/store/tags'
46+ import { isToday , format } from ' date-fns'
4647
4748interface Props {
4849 id: string
@@ -208,9 +209,11 @@ const onClickContextMenu = async () => {
208209 snippetStore .selectedMultiple = []
209210}
210211
211- const dateFormat = computed (() =>
212- new Intl .DateTimeFormat (' ru' ).format (props .date )
213- )
212+ const dateFormat = computed (() => {
213+ const date = new Date (props .date )
214+ if (isToday (date )) return format (date , ' HH:mm' )
215+ return format (date , ' dd.MM.yyyy' )
216+ })
214217
215218const onDragStart = (e : DragEvent ) => {
216219 if (snippetStore .selectedIds .length ) {
Original file line number Diff line number Diff line change @@ -4499,6 +4499,11 @@ dashdash@^1.12.0:
44994499 dependencies:
45004500 assert-plus "^1.0.0"
45014501
4502+ date-fns@^2.28.0:
4503+ version "2.28.0"
4504+ resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.28.0.tgz#9570d656f5fc13143e50c975a3b6bbeb46cd08b2"
4505+ integrity sha512-8d35hViGYx/QH0icHYCeLmsLmMUheMmTyV9Fcm6gvNwdw31yXXH+O85sOBJ+OLnLQMKZowvpKb6FgMIQjcpvQw==
4506+
45024507debounce-fn@^4.0.0:
45034508 version "4.0.0"
45044509 resolved "https://registry.yarnpkg.com/debounce-fn/-/debounce-fn-4.0.0.tgz#ed76d206d8a50e60de0dd66d494d82835ffe61c7"
You can’t perform that action at this time.
0 commit comments