expand_date_shortcut() public static method

Allowed shortcut formats are shown in the dialogue for edit timesheet entries (click the "?")
public static expand_date_shortcut ( string $date ) : string
$date string shortcut date
return string
Exemplo n.º 1
0
     break;
 }
 // get new data
 $data['projectID'] = $_REQUEST['projectID'];
 $data['designation'] = $_REQUEST['designation'];
 $data['comment'] = isset($_REQUEST['comment']) && !empty($_REQUEST['comment']) ? $_REQUEST['comment'] : '';
 $data['commentType'] = $_REQUEST['commentType'];
 $data['refundable'] = getRequestBool('refundable');
 $data['multiplier'] = getRequestDecimal($_REQUEST['multiplier']);
 $data['value'] = getRequestDecimal($_REQUEST['edit_value']);
 $data['userID'] = $kga['user']['userID'];
 if (!is_numeric($data['multiplier']) || $data['multiplier'] <= 0) {
     $errors['multiplier'] = $kga['lang']['errorMessages']['multiplierNegative'];
 }
 // parse new day and time
 $edit_day = Kimai_Format::expand_date_shortcut($_REQUEST['edit_day']);
 $edit_time = Kimai_Format::expand_time_shortcut($_REQUEST['edit_time']);
 // validate day and time
 $new = "{$edit_day}-{$edit_time}";
 if (!Kimai_Format::check_time_format($new)) {
     $errors[''] = $kga['lang']['TimeDateInputError'];
 }
 // convert to internal time format
 $new_time = convert_time_strings($new, $new);
 $data['timestamp'] = $new_time['in'];
 expenseAccessAllowed($data, $action, $errors);
 if (count($errors) > 0) {
     echo json_encode(array('errors' => $errors));
     break;
 }
 $result = false;