Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
olegstan committed Jul 2, 2024
1 parent 2b2d9b7 commit 249f8a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/Form/functions/formDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default function formDate(Base) {
renderDateTimeInput({
field,
text,
format = 'DD.MM.YYYY',
format = 'DD.MM.YYYY HH:mm:ss',
disabled = false,
callback,
size,
Expand Down Expand Up @@ -125,7 +125,7 @@ export default function formDate(Base) {
this.setValueInput(prv, field + '_date', null);
this.setValueInput(prv, field + '_datetime', null);
}
let momentDate = moment(date);
let momentDate = moment(date, format);

// Создаем новые значения для проверки изменений
let newField = momentDate && momentDate.isValid() ? momentDate.format('YYYY-MM-DD HH:mm:ss') : '';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "finform",
"version": "1.4.11",
"version": "1.4.12",
"description": "",
"main": "dist/index.js",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/Form/functions/formDate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default function formDate(Base)
/>
}

renderDateTimeInput({field, text, format = 'DD.MM.YYYY', disabled = false, callback, size, outsideCallback, className, style = {}, containerStyle = {}, placeholderStyle = {}, icon = false} = {}) {
renderDateTimeInput({field, text, format = 'DD.MM.YYYY HH:mm:ss', disabled = false, callback, size, outsideCallback, className, style = {}, containerStyle = {}, placeholderStyle = {}, icon = false} = {}) {
return <DateTime
id={this.getPrefix() + field}
type="text"
Expand All @@ -102,7 +102,7 @@ export default function formDate(Base)
this.setValueInput(prv, field + '_datetime', null);
}

let momentDate = moment(date);
let momentDate = moment(date, format);

// Создаем новые значения для проверки изменений
let newField = momentDate && momentDate.isValid() ? momentDate.format('YYYY-MM-DD HH:mm:ss') : '';
Expand Down

0 comments on commit 249f8a5

Please sign in to comment.