forked from External/greenlight
		
	Add timeago js library to show in the start_time of recordings
This commit is contained in:
		@@ -18,6 +18,7 @@
 | 
			
		||||
//= require jquery-ui
 | 
			
		||||
//= require dataTables/jquery.dataTables
 | 
			
		||||
//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
 | 
			
		||||
//= require rails-timeago-all
 | 
			
		||||
//= require bootstrap-sprockets
 | 
			
		||||
//= require turbolinks
 | 
			
		||||
//= require_self
 | 
			
		||||
 
 | 
			
		||||
@@ -45,10 +45,13 @@ class @Recordings
 | 
			
		||||
          targets: 0,
 | 
			
		||||
          render: (data, type, row) ->
 | 
			
		||||
            if type == 'display'
 | 
			
		||||
              return new Date(data)
 | 
			
		||||
              date = new Date(data)
 | 
			
		||||
              title = date
 | 
			
		||||
                .toLocaleString($('html').attr('lang'),
 | 
			
		||||
                  {month: 'long', day: 'numeric', year: 'numeric',
 | 
			
		||||
                  hour12: 'true', hour: '2-digit', minute: '2-digit'})
 | 
			
		||||
              timeago = '<time datetime="'+date.toISOString()+'" data-time-ago="'+date.toISOString()+'">'+date.toISOString()+'</time>'
 | 
			
		||||
              return title+'<span class="timeago">('+timeago+')</span>'
 | 
			
		||||
            return data
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
@@ -194,7 +197,7 @@ class @Recordings
 | 
			
		||||
        btn.prop('disabled', false)
 | 
			
		||||
      )
 | 
			
		||||
 | 
			
		||||
    this.table.on 'click', '.recording-delete', (event) ->
 | 
			
		||||
    @getTable().on 'click', '.recording-delete', (event) ->
 | 
			
		||||
      btn = $(this)
 | 
			
		||||
      row = table_api.row($(this).closest('tr')).data()
 | 
			
		||||
      url = $('.meeting-url').val()
 | 
			
		||||
@@ -209,6 +212,9 @@ class @Recordings
 | 
			
		||||
        btn.prop('disabled', false)
 | 
			
		||||
      )
 | 
			
		||||
 | 
			
		||||
    @getTable().on 'draw.dt', (event) ->
 | 
			
		||||
      $('time[data-time-ago]').timeago();
 | 
			
		||||
 | 
			
		||||
  getTable: ->
 | 
			
		||||
    @table
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user