Skip to content

Instantly share code, notes, and snippets.

@nocubicles
Created April 10, 2015 12:08
Show Gist options
  • Select an option

  • Save nocubicles/3d1b3ae7bc530ee4c74e to your computer and use it in GitHub Desktop.

Select an option

Save nocubicles/3d1b3ae7bc530ee4c74e to your computer and use it in GitHub Desktop.
<template name="insertProduct">
{{#autoForm collection="Products" id="insertProduct" type="insert" }}
<fieldset>
<legend>Lisa midagi</legend>
{{> afQuickField name="tooteNimetus"}}
{{> afQuickField name="partii"}}
{{> afQuickField name="trummel"}}
{{> afQuickField name="tootmistellimus"}}
</fieldset>
<button type="submit" class="btn btn-primary">Insert</button>
{{/autoForm}}
</template>
Template.insertProduct.events = {
'click submit': function(event) {
Meteor.call('startCountDown')
console.log("working?")
}
};
var startOfCountdown = new Date();
Meteor.methods({
startCountDown: function() {
Products.insert({
startOfCountdown: startOfCountdown.setHours(startOfCountdown.getHours() + 48),
})
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment