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

setValueExpression: currentDate() doesn't work for date and time input fields #8471

Closed
JaneSjs opened this issue Jun 26, 2024 · 0 comments · Fixed by #8484
Closed

setValueExpression: currentDate() doesn't work for date and time input fields #8471

JaneSjs opened this issue Jun 26, 2024 · 0 comments · Fixed by #8484
Assignees
Labels
bug user issue An issue or bug reported by users
Milestone

Comments

@JaneSjs
Copy link
Contributor

JaneSjs commented Jun 26, 2024

T18758 - Conditionally set currentDate() when Signature field is signed isn't working
https://surveyjs.answerdesk.io/internal/ticket/details/T18758


The currentDate() works if you set it as defaultValueExpression. However, if you use setValueIf and setValueExpression, the currentDate() doesn't work when a Single-Line Text Input has the 'Date and Time' input enabled.

{
 "pages": [
  {
   "name": "page3",
   "elements": [
    {
     "type": "signaturepad",
     "name": "signature"
    },
    {
     "type": "text",
     "name": "signatureDateInput",
     "title": "Date",
     "setValueIf": "{signature} notempty",
     "setValueExpression": "currentDate()",
     "inputType": "datetime-local"
    },
    {
     "type": "expression",
     "name": "signatureDate",
     "title": "Date",
     "setValueIf": "{signature} notempty",
     "setValueExpression": "getDate(currentDate())"
    }
   ]
  },
  {
   "name": "page4",
   "elements": [
    {
     "type": "matrixdropdown",
     "name": "question3",
     "columns": [
      {
       "name": "Column 1"
      },
      {
       "name": "Column 2"
      },
      {
       "name": "Column 3"
      }
     ],
     "choices": [
      1,
      2,
      3,
      4,
      5
     ],
     "rows": [
      "Row 1",
      "Row 2"
     ]
    }
   ]
  }
 ]
}
@JaneSjs JaneSjs added bug user issue An issue or bug reported by users labels Jun 26, 2024
@RomanTsukanov RomanTsukanov changed the title The setValueExpression: currentDate() doesn't work for Date and Time input fields setValueExpression: currentDate() doesn't work for date and time input fields Jul 2, 2024
@OlgaLarina OlgaLarina added this to the v1.11.5 milestone Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug user issue An issue or bug reported by users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants