Skip to content

Commit

Permalink
refactor: use european date format (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
faustbrian committed Nov 11, 2020
1 parent 29f0588 commit 686827a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions app/Services/Monitor/DelegateTracker.php
Expand Up @@ -438,24 +438,24 @@ private static function getActiveDelegates(array $delegates, int $height): array
$currentSeed = hex2bin(hash('sha256', $seedSource));
$delCount = count($delegates);

$seeds = [];
// $seeds = [];
for ($i = 0; $i < $delCount; $i++) {
$elements = [];
// $elements = [];

for ($x = 0; $x < 4 && $i < $delCount; $i++, $x++) {
$newIndex = intval(unpack('C*', $currentSeed)[$x + 1]) % $delCount;
$b = $delegates[$newIndex];
$delegates[$newIndex] = $delegates[$i];
$delegates[$i] = $b;

$elements[] = [
'i' => $i,
'x' => $x,
'newIndex' => $newIndex,
];
// $elements[] = [
// 'i' => $i,
// 'x' => $x,
// 'newIndex' => $newIndex,
// ];
}

$seeds[bin2hex($currentSeed)] = $elements;
// $seeds[bin2hex($currentSeed)] = $elements;

$currentSeed = hex2bin(hash('sha256', $currentSeed));
}
Expand Down
4 changes: 2 additions & 2 deletions resources/views/components/date-picker.blade.php
Expand Up @@ -3,11 +3,11 @@
x-ref="input"
x-init="new Pikaday({
field: $refs.input,
format: 'DD/MM/YYYY',
format: 'DD.MM.YYYY',
minDate: new Date('{{ Network::epoch() }}'),
maxDate: new Date(),
toString(date, format) {
return date.toLocaleDateString('en-US', { year: 'numeric', month: '2-digit', day: '2-digit' });
return date.toLocaleDateString('fi-FI', { year: 'numeric', month: '2-digit', day: '2-digit' });
},
})"
type="text"
Expand Down
4 changes: 2 additions & 2 deletions resources/views/components/search/block.blade.php
Expand Up @@ -120,7 +120,7 @@ class="w-full dark:text-theme-secondary-200 dark:bg-theme-secondary-900"
<x-general.search.advanced-option :title="trans('forms.search.date_range')">
<div class="flex items-center space-x-2">
<x-date-picker
placeholder="DD/MM/YYYY"
placeholder="DD.MM.YYYY"
class="w-full dark:text-theme-secondary-200 dark:bg-theme-secondary-900"
wire:model.defer="state.dateFrom"
wire:key="state_date_from"
Expand All @@ -129,7 +129,7 @@ class="w-full dark:text-theme-secondary-200 dark:bg-theme-secondary-900"
<span>-</span>

<x-date-picker
placeholder="DD/MM/YYYY"
placeholder="DD.MM.YYYY"
class="w-full dark:text-theme-secondary-200 dark:bg-theme-secondary-900"
wire:model.defer="state.dateTo"
wire:key="state_date_to"
Expand Down
4 changes: 2 additions & 2 deletions resources/views/components/search/transaction.blade.php
Expand Up @@ -81,7 +81,7 @@ class="w-full dark:text-theme-secondary-200 dark:bg-theme-secondary-900"
<x-general.search.advanced-option :title="trans('forms.search.date_range')">
<div class="flex items-center space-x-2">
<x-date-picker
placeholder="DD/MM/YYYY"
placeholder="DD.MM.YYYY"
class="w-full dark:text-theme-secondary-200 dark:bg-theme-secondary-900"
wire:model.defer="state.dateFrom"
wire:key="state_date_from"
Expand All @@ -90,7 +90,7 @@ class="w-full dark:text-theme-secondary-200 dark:bg-theme-secondary-900"
<span>-</span>

<x-date-picker
placeholder="DD/MM/YYYY"
placeholder="DD.MM.YYYY"
class="w-full dark:text-theme-secondary-200 dark:bg-theme-secondary-900"
wire:model.defer="state.dateTo"
wire:key="state_date_to"
Expand Down

0 comments on commit 686827a

Please sign in to comment.