Skip to content

Commit

Permalink
fix(table-date): correctly render date questions in table rows
Browse files Browse the repository at this point in the history
  • Loading branch information
czosel authored and Jonas Metzener committed Jun 12, 2019
1 parent 2b40b9c commit b07aa82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions addon/components/cf-field-value.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import moment from "moment";
import Component from "@ember/component";
import layout from "../templates/components/cf-field-value";
import { computed } from "@ember/object";
Expand Down Expand Up @@ -48,6 +49,11 @@ export default Component.extend({
label: answerValue && answerValue.name
};
}
case "DateQuestion": {
return {
label: moment(field.answer.value).format("L")
};
}

default:
return {
Expand Down
2 changes: 1 addition & 1 deletion addon/templates/components/cf-field/input/date.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{pikaday-wrapper
class="uk-input"
name=field.id
format="DD.MM.YYYY"
format="L"
onSelection=(action "onchange")
value=(get field.answer field.answer._valueKey)
disabled=disabled
Expand Down

0 comments on commit b07aa82

Please sign in to comment.