Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
cf1be81d
Commit
cf1be81d
authored
Oct 19, 2024
by
johnnyjoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: use date-picker instead of raw datetime input
parent
199d5680
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
17 deletions
+51
-17
package.json
web/package.json
+1
-0
pnpm-lock.yaml
web/pnpm-lock.yaml
+42
-0
index.tsx
web/src/components/MemoEditor/index.tsx
+8
-10
UserStatisticsView.tsx
web/src/components/UserStatisticsView.tsx
+0
-7
No files found.
web/package.json
View file @
cf1be81d
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
"lucide-react"
:
"^0.437.0"
,
"lucide-react"
:
"^0.437.0"
,
"mermaid"
:
"^11.2.1"
,
"mermaid"
:
"^11.2.1"
,
"react"
:
"^18.3.1"
,
"react"
:
"^18.3.1"
,
"react-datepicker"
:
"^7.5.0"
,
"react-dom"
:
"^18.3.1"
,
"react-dom"
:
"^18.3.1"
,
"react-force-graph-2d"
:
"^1.25.6"
,
"react-force-graph-2d"
:
"^1.25.6"
,
"react-hot-toast"
:
"^2.4.1"
,
"react-hot-toast"
:
"^2.4.1"
,
...
...
web/pnpm-lock.yaml
View file @
cf1be81d
...
@@ -80,6 +80,9 @@ importers:
...
@@ -80,6 +80,9 @@ importers:
react
:
react
:
specifier
:
^18.3.1
specifier
:
^18.3.1
version
:
18.3.1
version
:
18.3.1
react-datepicker
:
specifier
:
^7.5.0
version
:
7.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
react-dom
:
react-dom
:
specifier
:
^18.3.1
specifier
:
^18.3.1
version
:
18.3.1(react@18.3.1)
version
:
18.3.1(react@18.3.1)
...
@@ -655,6 +658,12 @@ packages:
...
@@ -655,6 +658,12 @@ packages:
react
:
'
>=16.8.0'
react
:
'
>=16.8.0'
react-dom
:
'
>=16.8.0'
react-dom
:
'
>=16.8.0'
'
@floating-ui/react@0.26.25'
:
resolution
:
{
integrity
:
sha512-hZOmgN0NTOzOuZxI1oIrDu3Gcl8WViIkvPMpB4xdd4QD6xAMtwgwr3VPoiyH/bLtRcS1cDnhxLSD1NsMJmwh/A==
}
peerDependencies
:
react
:
'
>=16.8.0'
react-dom
:
'
>=16.8.0'
'
@floating-ui/utils@0.2.8'
:
'
@floating-ui/utils@0.2.8'
:
resolution
:
{
integrity
:
sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==
}
resolution
:
{
integrity
:
sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==
}
...
@@ -1834,6 +1843,9 @@ packages:
...
@@ -1834,6 +1843,9 @@ packages:
resolution
:
{
integrity
:
sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==
}
resolution
:
{
integrity
:
sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==
}
engines
:
{
node
:
'
>=
0.4'
}
engines
:
{
node
:
'
>=
0.4'
}
date-fns@3.6.0
:
resolution
:
{
integrity
:
sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==
}
dayjs@1.11.13
:
dayjs@1.11.13
:
resolution
:
{
integrity
:
sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==
}
resolution
:
{
integrity
:
sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==
}
...
@@ -2810,6 +2822,12 @@ packages:
...
@@ -2810,6 +2822,12 @@ packages:
queue-microtask@1.2.3
:
queue-microtask@1.2.3
:
resolution
:
{
integrity
:
sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==
}
resolution
:
{
integrity
:
sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==
}
react-datepicker@7.5.0
:
resolution
:
{
integrity
:
sha512-6MzeamV8cWSOcduwePHfGqY40acuGlS1cG//ePHT6bVbLxWyqngaStenfH03n1wbzOibFggF66kWaBTb1SbTtQ==
}
peerDependencies
:
react
:
^16.9.0 || ^17 || ^18
react-dom
:
^16.9.0 || ^17 || ^18
react-dom@18.3.1
:
react-dom@18.3.1
:
resolution
:
{
integrity
:
sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==
}
resolution
:
{
integrity
:
sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==
}
peerDependencies
:
peerDependencies
:
...
@@ -3167,6 +3185,9 @@ packages:
...
@@ -3167,6 +3185,9 @@ packages:
resolution
:
{
integrity
:
sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==
}
resolution
:
{
integrity
:
sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==
}
engines
:
{
node
:
^14.18.0 || >=16.0.0
}
engines
:
{
node
:
^14.18.0 || >=16.0.0
}
tabbable@6.2.0
:
resolution
:
{
integrity
:
sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==
}
tailwind-merge@2.5.2
:
tailwind-merge@2.5.2
:
resolution
:
{
integrity
:
sha512-kjEBm+pvD+6eAwzJL2Bi+02/9LFLal1Gs61+QB7HvTfQQ0aXwC5LGT8PEt1gS0CWKktKe6ysPTAy3cBC5MeiIg==
}
resolution
:
{
integrity
:
sha512-kjEBm+pvD+6eAwzJL2Bi+02/9LFLal1Gs61+QB7HvTfQQ0aXwC5LGT8PEt1gS0CWKktKe6ysPTAy3cBC5MeiIg==
}
...
@@ -3902,6 +3923,14 @@ snapshots:
...
@@ -3902,6 +3923,14 @@ snapshots:
react
:
18.3.1
react
:
18.3.1
react-dom
:
18.3.1(react@18.3.1)
react-dom
:
18.3.1(react@18.3.1)
'
@floating-ui/react@0.26.25(react-dom@18.3.1(react@18.3.1))(react@18.3.1)'
:
dependencies
:
'
@floating-ui/react-dom'
:
2.1.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'
@floating-ui/utils'
:
0.2.8
react
:
18.3.1
react-dom
:
18.3.1(react@18.3.1)
tabbable
:
6.2.0
'
@floating-ui/utils@0.2.8'
:
{}
'
@floating-ui/utils@0.2.8'
:
{}
'
@github/relative-time-element@4.4.3'
:
{}
'
@github/relative-time-element@4.4.3'
:
{}
...
@@ -5132,6 +5161,8 @@ snapshots:
...
@@ -5132,6 +5161,8 @@ snapshots:
es-errors
:
1.3.0
es-errors
:
1.3.0
is-data-view
:
1.0.1
is-data-view
:
1.0.1
date-fns@3.6.0
:
{}
dayjs@1.11.13
:
{}
dayjs@1.11.13
:
{}
debug@4.3.7
:
debug@4.3.7
:
...
@@ -6227,6 +6258,15 @@ snapshots:
...
@@ -6227,6 +6258,15 @@ snapshots:
queue-microtask@1.2.3
:
{}
queue-microtask@1.2.3
:
{}
react-datepicker@7.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
:
dependencies
:
'
@floating-ui/react'
:
0.26.25(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
clsx
:
2.1.1
date-fns
:
3.6.0
prop-types
:
15.8.1
react
:
18.3.1
react-dom
:
18.3.1(react@18.3.1)
react-dom@18.3.1(react@18.3.1)
:
react-dom@18.3.1(react@18.3.1)
:
dependencies
:
dependencies
:
loose-envify
:
1.4.0
loose-envify
:
1.4.0
...
@@ -6632,6 +6672,8 @@ snapshots:
...
@@ -6632,6 +6672,8 @@ snapshots:
'
@pkgr/core'
:
0.1.1
'
@pkgr/core'
:
0.1.1
tslib
:
2.7.0
tslib
:
2.7.0
tabbable@6.2.0
:
{}
tailwind-merge@2.5.2
:
{}
tailwind-merge@2.5.2
:
{}
tailwindcss-animate@1.0.7(tailwindcss@3.4.12)
:
tailwindcss-animate@1.0.7(tailwindcss@3.4.12)
:
...
...
web/src/components/MemoEditor/index.tsx
View file @
cf1be81d
...
@@ -2,6 +2,8 @@ import { Select, Option, Button, Divider } from "@mui/joy";
...
@@ -2,6 +2,8 @@ import { Select, Option, Button, Divider } from "@mui/joy";
import
{
isEqual
}
from
"lodash-es"
;
import
{
isEqual
}
from
"lodash-es"
;
import
{
SendIcon
}
from
"lucide-react"
;
import
{
SendIcon
}
from
"lucide-react"
;
import
React
,
{
useEffect
,
useMemo
,
useRef
,
useState
}
from
"react"
;
import
React
,
{
useEffect
,
useMemo
,
useRef
,
useState
}
from
"react"
;
import
DatePicker
from
"react-datepicker"
;
import
"react-datepicker/dist/react-datepicker.css"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
toast
}
from
"react-hot-toast"
;
import
{
useTranslation
}
from
"react-i18next"
;
import
{
useTranslation
}
from
"react-i18next"
;
import
useLocalStorage
from
"react-use/lib/useLocalStorage"
;
import
useLocalStorage
from
"react-use/lib/useLocalStorage"
;
...
@@ -428,16 +430,12 @@ const MemoEditor = (props: Props) => {
...
@@ -428,16 +430,12 @@ const MemoEditor = (props: Props) => {
onCompositionEnd=
{
handleCompositionEnd
}
onCompositionEnd=
{
handleCompositionEnd
}
>
>
{
memoName
&&
displayTime
&&
(
{
memoName
&&
displayTime
&&
(
<
div
className=
"relative text-sm"
>
<
DatePicker
<
span
className=
"cursor-pointer text-gray-400 dark:text-gray-500"
>
{
displayTime
.
toLocaleString
()
}
</
span
>
selected=
{
displayTime
}
<
input
onChange=
{
(
date
)
=>
date
&&
setDisplayTime
(
date
)
}
className=
"inset-0 absolute z-1 opacity-0"
showTimeSelect
type=
"datetime-local"
customInput=
{
<
span
className=
"cursor-pointer text-sm text-gray-400 dark:text-gray-500"
>
{
displayTime
.
toLocaleString
()
}
</
span
>
}
value=
{
displayTime
.
toLocaleString
()
}
onFocus=
{
(
e
:
any
)
=>
e
.
target
.
showPicker
()
}
onChange=
{
(
e
)
=>
setDisplayTime
(
new
Date
(
e
.
target
.
value
))
}
/>
/>
</
div
>
)
}
)
}
<
Editor
ref=
{
editorRef
}
{
...
editorConfig
}
/>
<
Editor
ref=
{
editorRef
}
{
...
editorConfig
}
/>
<
ResourceListView
resourceList=
{
state
.
resourceList
}
setResourceList=
{
handleSetResourceList
}
/>
<
ResourceListView
resourceList=
{
state
.
resourceList
}
setResourceList=
{
handleSetResourceList
}
/>
...
...
web/src/components/UserStatisticsView.tsx
View file @
cf1be81d
...
@@ -74,13 +74,6 @@ const UserStatisticsView = () => {
...
@@ -74,13 +74,6 @@ const UserStatisticsView = () => {
<
div
className=
"relative text-base font-medium leading-6 flex flex-row items-center dark:text-gray-400"
>
<
div
className=
"relative text-base font-medium leading-6 flex flex-row items-center dark:text-gray-400"
>
<
CalendarDaysIcon
className=
"w-5 h-auto mr-1 opacity-60"
strokeWidth=
{
1.5
}
/>
<
CalendarDaysIcon
className=
"w-5 h-auto mr-1 opacity-60"
strokeWidth=
{
1.5
}
/>
<
span
>
{
dayjs
(
visibleMonthString
).
toDate
().
toLocaleString
(
i18n
.
language
,
{
year
:
"numeric"
,
month
:
"long"
})
}
</
span
>
<
span
>
{
dayjs
(
visibleMonthString
).
toDate
().
toLocaleString
(
i18n
.
language
,
{
year
:
"numeric"
,
month
:
"long"
})
}
</
span
>
<
input
className=
"inset-0 absolute z-1 opacity-0"
type=
"month"
value=
{
visibleMonthString
}
onFocus=
{
(
e
:
any
)
=>
e
.
target
.
showPicker
()
}
onChange=
{
(
e
)
=>
setVisibleMonthString
(
e
.
target
.
value
||
dayjs
().
format
(
"YYYY-MM"
))
}
/>
</
div
>
</
div
>
<
div
className=
"invisible group-hover:visible flex justify-end items-center"
>
<
div
className=
"invisible group-hover:visible flex justify-end items-center"
>
<
Popover
>
<
Popover
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment