<commit_before>@if ($showStart)
	<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/jquery-bootgrid/1.2.0/jquery.bootgrid.min.css">

	<div>
		<table id="grid-data" class="table table-condensed table-hover table-striped">
			<thead>
				<tr>
@endif

@if ($showColumns)
	@foreach ($columns as $column)
		@if( ! in_array($column->getName(), $exclude) )
			{!! $column->render() !!}
		@endif
	@endforeach
@endif

@if ($showEnd)
				</tr>
			</thead>
		</table>
	</div>

	<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-bootgrid/1.2.0/jquery.bootgrid.min.js"></script>

	<script type="text/javascript">
		$("#grid-data").bootgrid({
			ajax: true,
			ajaxSettings: {
				method: "{!! $datagridOptions['method'] !!}"
			},
			url: "{!! $datagridOptions['url'] !!}",
			requestHandler: function(request)
			{
				return {
					"page": request.current,
					"per_page": request.rowCount,
					"sort": Object.keys(request.sort)[0],
					"order": request.sort[Object.keys(request.sort)[0]],
					"search": request.searchPhrase
				}
			},
			responseHandler: function (response)
			{
				return {
					"current": response.meta.pagination.current_page,
					"rowCount": response.meta.pagination.per_page,
					"total": response.meta.pagination.total,
					"rows": response.data
				};
			},
			converters: {
		        date: {
		            from: function (value) { return Date.parse(value); },
		            to: function (value) { return new Date(value).toISOString().split('T')[0]; }
		        }
		    },
			formatters: {
				"link": function(column, row)
				{
					return '<a href="/admin/promotions/show/' + row.id + '">Voir</a>';
				},
				"date": function(column, row)
				{
					return row.dateDebut.split(' ')[0];
				}
			}
		});
	</script>
@endif
<commit_msg>Added Datetime support to jQuery Bootgrid<commit_after>@if ($showStart)
	<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/jquery-bootgrid/1.2.0/jquery.bootgrid.min.css">

	<div>
		<table id="grid-data" class="table table-condensed table-hover table-striped">
			<thead>
				<tr>
@endif

@if ($showColumns)
	@foreach ($columns as $column)
		@if( ! in_array($column->getName(), $exclude) )
			{!! $column->render() !!}
		@endif
	@endforeach
@endif

@if ($showEnd)
				</tr>
			</thead>
		</table>
	</div>

	<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-bootgrid/1.2.0/jquery.bootgrid.min.js"></script>

	<script type="text/javascript">
		$("#grid-data").bootgrid({
			ajax: true,
			ajaxSettings: {
				method: "{!! $datagridOptions['method'] !!}"
			},
			url: "{!! $datagridOptions['url'] !!}",
			requestHandler: function(request)
			{
				return {
					"page": request.current,
					"per_page": request.rowCount,
					"sort": Object.keys(request.sort)[0],
					"order": request.sort[Object.keys(request.sort)[0]],
					"search": request.searchPhrase
				}
			},
			responseHandler: function (response)
			{
				return {
					"current": response.meta.pagination.current_page,
					"rowCount": response.meta.pagination.per_page,
					"total": response.meta.pagination.total,
					"rows": response.data
				};
			},
			converters: {
		        date: {
		            from: function (value) { return Date.parse(value); },
		            to: function (value) { return new Date(value).toISOString().split('T')[0]; }
		        },
                datetime: {
                    from: function (value) { return Date.parse(value); },
                    to: function (value) {
                        function pad(number) {
                          if (number < 10) {
                            return '0' + number;
                          }
                          return number;
                        }

                        var d = new Date(value);
                        return d.getUTCFullYear() +
                            '-' + pad(d.getUTCMonth() + 1) +
                            '-' + pad(d.getUTCDate()) +
                            ' ' + pad(d.getUTCHours()) +
                            ':' + pad(d.getUTCMinutes()) +
                            ':' + pad(d.getUTCSeconds());
                    }
                },
		    },
			formatters: {
				"link": function(column, row)
				{
					return '<a href="/admin/promotions/show/' + row.id + '">Voir</a>';
				},
			}
		});
	</script>
@endif

{'fraction_non_alphanumeric': 0.18075993850208655, 'fraction_numerical': 0.006369426751592357, 'mean_word_length': 2.2206506364922207, 'pattern_counts': {'":': 21, '<': 38, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3274935', 'n_tokens_mistral': 1778, 'n_tokens_neox': 1486, 'n_words': 240}