Skip to content

Commit

Permalink
Merge pull request #41 from Sharifur/dev
Browse files Browse the repository at this point in the history
user panel attendance calendar issue solved
  • Loading branch information
Sharifur committed Jan 22, 2024
2 parents 5aff0b6 + d6113e0 commit 192e032
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/User/AttendanceCheckController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function check(Request $request){

$logs = $logQeuery->where("status",1)->orderBy("date_time")->get();

$logsInfo = $this->logAsArray($logs);
$logsInfo = $this->logAsArray(logs:$logs,dateTime:true);



Expand Down
4 changes: 2 additions & 2 deletions app/Http/Traits/AttendanceHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

trait AttendanceHelper
{
public function logAsArray(\Illuminate\Database\Eloquent\Collection|array|\LaravelIdea\Helper\App\Models\_IH_AttendanceLog_C $logs)
public function logAsArray(\Illuminate\Database\Eloquent\Collection|array|\LaravelIdea\Helper\App\Models\_IH_AttendanceLog_C $logs,$dateTime=false)
{
$logsInfo = [];
foreach($logs as $log){
Expand All @@ -31,7 +31,7 @@ public function logAsArray(\Illuminate\Database\Eloquent\Collection|array|\Larav
str_replace("c/","",strtolower($log->type))."_time" =>
$log->type === "holiday" ? " ": $log->date_time->format('g:i A'),
"working_nature" => $this->workNature($log->type),
"dateTime" => $parsed_date
"dateTime" => $dateTime ? $log->date_time : $parsed_date

];
}
Expand Down
8 changes: 4 additions & 4 deletions resources/js/Pages/User/AttendanceCheck.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<li class="work-from-home">Work From Home<span class="badge">{{workFormHome}}</span></li>
</ul>
</div>

<Calendar
class="custom-calendar-outer-wrap"
:masks="CalendarData().masks"
Expand Down Expand Up @@ -73,7 +74,6 @@

<script>
import {Head,Link,useForm,usePage} from '@inertiajs/inertia-vue3';
import AdminMaster from "@/Layouts/AdminMaster.vue";
import BsSelect from "@/Components/BsForm/Select.vue";
import BsButton from "@/Components/BsForm/Button.vue";
import Datepicker from 'vue3-datepicker'
Expand Down Expand Up @@ -123,7 +123,7 @@ export default {
})
.then((response) => {
let logs = response.data.logs;
// console.log(Object.keys(logs).length);
if (Object.keys(logs).length > 0){
let attenData = logs;
let calendarData = [];
Expand All @@ -134,12 +134,12 @@ export default {
return;
}
calendarData.push({
key: key,
key: `${key}-${Math.random()}`,
customData: {
title: `${key.replaceAll("_"," ")}: ${currentItem[key]}`,
class: key
},
dates: new Date(currentItem.dateTime),
dates: new Date(currentItem.dateTime)
})
});
});
Expand Down

0 comments on commit 192e032

Please sign in to comment.