Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
UNRELEASED CHANGES:

* Fix message in contact edit page
* Fix months list for non english languages in contact edit page
* Fix birthdate calendar for non english languages in contact edit page
* Fix Gravatar support
* Remove partial contacts from search results returned by the API
* Fix reset account deleting default account values
Expand Down
6 changes: 3 additions & 3 deletions app/Helpers/DateHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,16 @@ public static function getNextTheoriticalBillingDate(String $interval)
*/
public static function getListOfMonths()
{
Carbon::setLocale(auth()->user()->locale);
Date::setLocale(auth()->user()->locale);
$months = collect([]);
$currentDate = Carbon::now();
$currentDate = Date::now();
$currentDate->day = 1;

for ($month = 1; $month < 13; $month++) {
$currentDate->month = $month;
$months->push([
'id' => $month,
'name' => $currentDate->formatLocalized('%B'),
'name' => mb_convert_case($currentDate->format('F'), MB_CASE_TITLE, 'UTF-8'),
]);
}

Expand Down
17 changes: 5 additions & 12 deletions app/Http/ViewComposers/DateSelectViewComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

namespace App\Http\ViewComposers;

use Carbon\Carbon;
use Illuminate\View\View;
use Jenssegers\Date\Date;
use App\Helpers\DateHelper;

class DateSelectViewComposer
{
Expand All @@ -20,20 +21,12 @@ public function __construct()
public function compose(View $view)
{
// Months
Carbon::setLocale(auth()->user()->locale);
$months = [];
$currentDate = Carbon::now();
$currentDate->day = 1;

for ($month = 1; $month < 13; $month++) {
$currentDate->month = $month;
array_push($months, $currentDate->formatLocalized('%B'));
}
$months = DateHelper::getListOfMonths();

// Years
$years = [];
$maxYear = Carbon::now(auth()->user()->timezone)->year;
$minYear = Carbon::now(auth()->user()->timezone)->subYears(120)->format('Y');
$maxYear = Date::now(auth()->user()->timezone)->year;
$minYear = Date::now(auth()->user()->timezone)->subYears(120)->format('Y');

for ($year = $maxYear; $year >= $minYear; $year--) {
array_push($years, $year);
Expand Down
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/app.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"/js/app.js": "/js/app.js?id=32bf654f0b3e3d64d04a",
"/js/app.js": "/js/app.js?id=d05ffc9de1c53b7a7c81",
"/css/app.css": "/css/app.css?id=f52285cef1e0853aec3f",
"/css/stripe.css": "/css/stripe.css?id=956554a2e96db30fafa3",
"/js/app.js.map": "/js/app.js.map?id=812548720d5b56b5f44a",
"/js/app.js.map": "/js/app.js.map?id=457e24747d8dd360c138",
"/css/app.css.map": "/css/app.css.map?id=516bf3da4d93de8e038d",
"/css/stripe.css.map": "/css/stripe.css.map?id=2be6f42e97a043f30026",
"/js/stripe.js": "/js/stripe.js?id=2ab8adacb3b594bc272d",
Expand Down
4 changes: 4 additions & 0 deletions resources/assets/js/components/partials/form/Date.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<datepicker :value="selectedDate"
:name="id"
:format="format"
v-bind:language="locale"
:input-class="'br2 f5 ba b--black-40 pa2 outline-0'">
</datepicker>
</div>
Expand Down Expand Up @@ -47,6 +48,9 @@
defaultDate: {
type: String,
},
locale: {
type: String,
},
},

methods: {
Expand Down
6 changes: 5 additions & 1 deletion resources/assets/js/components/partials/form/SpecialDate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@

<form-date
v-bind:id="'birthdayDate'"
v-bind:default-date="defaultDate">
v-bind:default-date="defaultDate"
v-bind:locale="locale">
</form-date>

<div class="mt3 form-information-message br2">
Expand Down Expand Up @@ -127,6 +128,9 @@
age: {
type: String,
},
locale: {
type: String,
},
},
}
</script>
8,427 changes: 4,566 additions & 3,861 deletions resources/assets/js/vue-i18n-locales.generated.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions resources/views/partials/components/date-select.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<div class="mt2">

<select id="{{ $class }}_month" name="{{ $class }}_month" class="mr2">
@foreach($months as $month => $value)
<option value="{{ $month + 1 }}"
{{ ($specialDate == null) ? '' : (($specialDate->date->month == ($month + 1)) ? 'selected="selected"': '') }}
@foreach($months as $month)
<option value="{{ $month['id'] }}"
{{ ($specialDate == null) ? '' : (($specialDate->date->month == $month['id']) ? 'selected="selected"': '') }}
>
{{ $value }}
{{ $month['name'] }}
</option>
@endforeach
</select>
Expand Down
1 change: 1 addition & 0 deletions resources/views/people/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
v-bind:day="{{ $day }}"
v-bind:age="'{{ $age }}'"
v-bind:default-date="'{{ $birthdate }}'"
v-bind:locale="'{{ auth()->user()->locale }}'"
:value="'{{ $birthdayState }}'"
></form-specialdate>
</div>
Expand Down