File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
src/renderer/components/snippets Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 38
38
"@vueuse/core" : " ^8.1.2" ,
39
39
"ace-builds" : " ^1.4.14" ,
40
40
"axios" : " ^0.26.1" ,
41
+ "date-fns" : " ^2.28.0" ,
41
42
"electron-store" : " ^8.0.1" ,
42
43
"fs-extra" : " ^10.0.1" ,
43
44
"highlight.js" : " ^11.5.1" ,
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ import { onClickOutside } from '@vueuse/core'
43
43
import { computed , ref } from ' vue'
44
44
import type { SystemFolderAlias } from ' @shared/types/renderer/sidebar'
45
45
import { useTagStore } from ' @/store/tags'
46
+ import { isToday , format } from ' date-fns'
46
47
47
48
interface Props {
48
49
id: string
@@ -208,9 +209,11 @@ const onClickContextMenu = async () => {
208
209
snippetStore .selectedMultiple = []
209
210
}
210
211
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
+ })
214
217
215
218
const onDragStart = (e : DragEvent ) => {
216
219
if (snippetStore .selectedIds .length ) {
Original file line number Diff line number Diff line change @@ -4499,6 +4499,11 @@ dashdash@^1.12.0:
4499
4499
dependencies:
4500
4500
assert-plus "^1.0.0"
4501
4501
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
+
4502
4507
debounce-fn@^4.0.0:
4503
4508
version "4.0.0"
4504
4509
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