Skip to content

Instantly share code, notes, and snippets.

@PankajWorks
Last active March 2, 2017 10:11
Show Gist options
  • Save PankajWorks/08e23228e7352a0b892a214f240641b9 to your computer and use it in GitHub Desktop.
Save PankajWorks/08e23228e7352a0b892a214f240641b9 to your computer and use it in GitHub Desktop.

Revisions

  1. Pankaj Singh revised this gist Mar 2, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion updateDateTime.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    mport Ember from 'ember';
    // Sample handelbar code <h5> Current System Date- {{utctime}} (UTC)</h5>
    import Ember from 'ember';
    import config from './../config/environment';


  2. Pankaj Singh revised this gist Feb 28, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion updateDateTime.js
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ export default Ember.Route.extend({
    model() {
    var store = this.store;
    return Ember.RSVP.hash({
    todayruns: Ember.$.ajax({ url: config.server_host + '/' + config.api + '/runinfo?query=' + this.get('query'), dataType: "json", type: 'GET' }),
    todayruns: Ember.$.ajax({ url: config.server_host + '/' + config.api + '/runs?query=' + this.get('query'), dataType: "json", type: 'GET' }),
    });
    },
    setupController(controller, model) {
  3. Pankaj Singh revised this gist Feb 28, 2017. No changes.
  4. Pankaj Singh created this gist Feb 28, 2017.
    25 changes: 25 additions & 0 deletions updateDateTime.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    mport Ember from 'ember';
    import config from './../config/environment';


    export default Ember.Route.extend({
    query: 'from_unixtime(start_time)>=curdate() and from_unixtime(start_time)<=DATE_ADD(curdate(),INTERVAL+1 day)',
    model() {
    var store = this.store;
    return Ember.RSVP.hash({
    todayruns: Ember.$.ajax({ url: config.server_host + '/' + config.api + '/runinfo?query=' + this.get('query'), dataType: "json", type: 'GET' }),
    });
    },
    setupController(controller, model) {
    this._super(controller, model);
    this.startWatchingTime(controller);
    controller.set('todayruns', model.todayruns);
    },
    startWatchingTime: function(controller){
    var self = this;
    controller.set('utctime', moment.utc().format('YYYY-MM-DD HH:mm:ss'));
    Ember.run.later(function(){
    self.startWatchingTime(controller);
    }, 1000);
    }
    });