mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
fix attendance retroactive
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ class AjaxInterface{
|
||||
{
|
||||
global $CURUSER;
|
||||
$rep = new \App\Repositories\AttendanceRepository();
|
||||
return $rep->retroactive($CURUSER['id'], $params['timestamp']);
|
||||
return $rep->retroactive($CURUSER['id'], $params['date']);
|
||||
}
|
||||
|
||||
public static function getPtGen($params)
|
||||
|
||||
@@ -89,23 +89,19 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
eventClick: function(info) {
|
||||
console.log(info.event);
|
||||
if (info.event.groupId == 'to_do') {
|
||||
retroactive(info.event.start)
|
||||
retroactive(info.event.startStr)
|
||||
}
|
||||
}
|
||||
});
|
||||
calendar.render();
|
||||
});
|
||||
|
||||
function retroactive(start) {
|
||||
let year = start.getFullYear()
|
||||
let month = start.getMonth() + 1
|
||||
let day = start.getDate()
|
||||
let date = year + '-' + month + '-' + day
|
||||
if (!window.confirm(confirmText + date + ' ?')) {
|
||||
function retroactive(dateStr) {
|
||||
if (!window.confirm(confirmText + dateStr + ' ?')) {
|
||||
console.log("cancel")
|
||||
return
|
||||
}
|
||||
jQuery.post('ajax.php', {params: {timestamp: start.getTime()}, action: 'attendanceRetroactive'}, function (response) {
|
||||
jQuery.post('ajax.php', {params: {date: dateStr}, action: 'attendanceRetroactive'}, function (response) {
|
||||
console.log(response);
|
||||
if (response.ret != 0) {
|
||||
alert(response.msg)
|
||||
|
||||
Reference in New Issue
Block a user