Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datetime widget fixes and improvements #7261

Merged
merged 23 commits into from
Aug 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ef46f40
fix: set default values if format is boolean
martinjagodic Jul 4, 2024
54b7b46
Pass avatar_url un git-gateway backend (#7247)
loteoo Jul 8, 2024
0fb9dd3
fix: update ukrainian lang (#7252)
olegfedak Jul 29, 2024
daa62ab
fix(select-widget): select widget not able to select number value `0`…
imangd Aug 1, 2024
a46b441
fix: fetch GitHub PR author name, fixes #7232 (#7253)
domcleal Aug 1, 2024
70b038b
Remove typo from error message (#7249)
ryangittings Aug 1, 2024
29f7f48
Change `Authorization` header type for API requests from "token" to "…
floscher Aug 1, 2024
aef22c7
fix(backend): allow a custom API root for backend (#7214)
JbIPS Aug 2, 2024
1115dd0
fix(i18n): allow to store the new entry in the draft after a pre save…
jmfiaschi Aug 2, 2024
9ff2d20
fix: improve field error position (#7260)
martinjagodic Aug 2, 2024
65952c4
fix(i18n): improve Thai locale (#7248)
weeix Aug 5, 2024
427ed00
fix: make default value empty
martinjagodic Aug 5, 2024
b6e5957
feat: add {{now}} option as datetime default
martinjagodic Aug 5, 2024
f77b625
Merge branch 'main' into datetime
martinjagodic Aug 5, 2024
febbc22
feat: add UTC indicator to datetime control
martinjagodic Aug 7, 2024
cd604d8
fix: format
martinjagodic Aug 7, 2024
5d322bd
fix: convert Z to [Z] if picker_utc: true
martinjagodic Aug 7, 2024
cecda08
fix: reorder getFormat so that `format`comes before time and date for…
martinjagodic Aug 7, 2024
72d69a0
fix: formatting
martinjagodic Aug 7, 2024
18b83ed
Merge branch 'main' into datetime
martinjagodic Aug 7, 2024
92875ce
fix: add defaults to test datetime
martinjagodic Aug 8, 2024
61a3b88
feat: add datetime unit test
martinjagodic Aug 8, 2024
7b0cf78
fix: make datetime test work
martinjagodic Aug 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: format
  • Loading branch information
martinjagodic committed Aug 7, 2024
commit cd604d86c66cbbc2e619446e4f9704ed14ca9ad9
14 changes: 9 additions & 5 deletions packages/decap-cms-widget-datetime/src/DateTimeControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class DateTimeControl extends React.Component {
const { format, inputFormat } = this.getFormat();

if (value?.replace(/\s+/g, '') === '{{now}}') {
return this.isUtc ? dayjs.utc().format(inputFormat) : dayjs().format(inputFormat)
return this.isUtc ? dayjs.utc().format(inputFormat) : dayjs().format(inputFormat);
}

const inputValue = this.isUtc
Expand Down Expand Up @@ -154,10 +154,14 @@ class DateTimeControl extends React.Component {
disabled={isDisabled}
/>
{this.isUtc && (
<span css={css`
font-size: 0.8em;
color: #666;
`}>UTC</span>
<span
css={css`
font-size: 0.8em;
color: #666;
`}
>
UTC
</span>
)}
{!isDisabled && (
<Buttons
Expand Down
Loading