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

Finalize v2 docs #92

Open
2 tasks
jonjamz opened this issue Feb 25, 2016 · 6 comments
Open
2 tasks

Finalize v2 docs #92

jonjamz opened this issue Feb 25, 2016 · 6 comments

Comments

@jonjamz
Copy link
Owner

jonjamz commented Feb 25, 2016

Continued from #14.

  • Align API method names in v2 docs with current method names.
  • Find and fix broken example components.
@jonjamz jonjamz changed the title Finish v2 docs, test and fix any broken examples Finalize v2 docs Feb 25, 2016
@7ammer
Copy link

7ammer commented Feb 25, 2016

Hey @jonjamz, The validationValue needs amending in AdjustableNumberOfInputs

This outputs correctly for me...

validationValue: function (el, clean, template) {
   var values = $.map($(el).find("input"), function(e,i) {
      return $(e).val();
   });
  return values;
},

jonjamz added a commit that referenced this issue Feb 25, 2016
@jonjamz
Copy link
Owner Author

jonjamz commented Feb 25, 2016

Thanks, fixed that one.

@7ammer
Copy link

7ammer commented Feb 25, 2016

Oops forgot to mention: TemplatesForms.registerFormElement should be ReactiveForms.createElement. ...Unless you're changing the method names in the next version.

@jonjamz
Copy link
Owner Author

jonjamz commented Feb 25, 2016

Yes I think in the next update I will change the namespace and method names, but I will keep aliases for backwards compatibility.

@7ammer
Copy link

7ammer commented Feb 25, 2016

The validationValue for DateAndTime needs amending.

The below worked for me:

<template name="dateTimeElement">
    <div class="reactive-element">
        Date: <input type="date" value={{dateToString value}}><br>
        Time: <input type="time" value={{timeToString value}}>
    </div>
    {{#if submitted}}
        {{#if errorMessage}}<p class="error-message">{{errorMessage}}</p>{{/if}}
    {{/if}}
</template>
Template.dateTimeElement.helpers({
    dateToString: function(val){
        return new Date(val).toDateString();
    },
    timeToString: function(val){
        return new Date(val).toTimeString();
    }
});

ReactiveForms.createElement({
  template: 'dateTimeElement',
  validationEvent: 'change',
  validationValue: function (el, clean, template) {
      var values = $.map($(el).find("input"), function(e,i) {
          return $(e).val();
      });
      return new Date(values.join('T')); // A single Date Object.
  }
});

@jonjamz
Copy link
Owner Author

jonjamz commented Feb 26, 2016

Fixed that one too, thanks.

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

No branches or pull requests

2 participants