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

CLI-generated form doesn't generate input for date properties from the model #101

Open
e2jk opened this issue Feb 18, 2015 · 1 comment
Open

Comments

@e2jk
Copy link
Contributor

e2jk commented Feb 18, 2015

A model with these props:

    props: {
        id: 'any',
        abbreviation: ['string', true, ''],
        description: ['string', false, ''],
        notes: ['string', false, ''],
        fromDate: ['date', false, ''],
        toDate: ['date', false, ''],
        numberOfRecords: ['number', false, '']
    },

generates the following form by calling $ ampersand gen form client/models/object.js:

var FormView = require("ampersand-form-view");
var InputView = require("ampersand-input-view");


module.exports = FormView.extend({
    fields: function () {
        return [
            new InputView({
                label: "Abbreviation",
                name: "abbreviation",
                value: this.model.abbreviation || "",
                required: false,
                placeholder: "Abbreviation",
                parent: this
            }),
            new InputView({
                label: "Description",
                name: "description",
                value: this.model.description || "",
                required: false,
                placeholder: "Description",
                parent: this
            }),
            new InputView({
                label: "Notes",
                name: "notes",
                value: this.model.notes || "",
                required: false,
                placeholder: "Notes",
                parent: this
            }),
            new InputView({
                label: "Number Of Records",
                name: "numberOfRecords",
                value: this.model.numberOfRecords || "",
                required: false,
                placeholder: "Number Of Records",
                parent: this
            })
        ];
    }
});

Where are the fromDate and toDate inputs? Note that they are defined as date dataType in the model.

@e2jk
Copy link
Contributor Author

e2jk commented Feb 18, 2015

Note that until now I have only had models that use the dataTypes string, number and date, and have only encountered this issue with date. This issue needs to be checked for the other dataTypes (boolean, array, object, any and custom dataTypes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants