Skip to content

Commit

Permalink
Update formfiller to support datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
kennsippell committed Aug 8, 2023
1 parent 1c84fcf commit 48f08a8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/all-chts-bundle.dev.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/form-host-cht-core-4-0.dev.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion docs/form-host_form-filler.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ <h1 class="page-title">Source: form-host/form-filler.js</h1>
case 'text':
if (allInputs.parent().hasClass('date')) {
allInputs.first().datepicker('setDate', answer);
} if (allInputs.hasClass('timepicker-default')) {
const [date, time] = answer.split(' ', 2);
allInputs.eq(0).datepicker('setDate', date);
allInputs.eq(1).val(time).trigger('change');
} else {
allInputs.val(answer).trigger('change');
}
Expand Down Expand Up @@ -303,7 +307,7 @@ <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="mock.cht-
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Thu Mar 23 2023 18:15:28 GMT+0000 (Greenwich Mean Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Tue Aug 08 2023 12:22:47 GMT-0700 (Pacific Daylight Saving Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
4 changes: 4 additions & 0 deletions src/form-host/form-filler.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ const fillQuestion = (question, answer) => {
case 'text':
if (allInputs.parent().hasClass('date')) {
allInputs.first().datepicker('setDate', answer);
} if (allInputs.hasClass('timepicker-default')) {
const [date, time] = answer.split(' ', 2);
allInputs.eq(0).datepicker('setDate', date);
allInputs.eq(1).val(time).trigger('change');
} else {
allInputs.val(answer).trigger('change');
}
Expand Down
Loading

0 comments on commit 48f08a8

Please sign in to comment.