mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
calendarDate preparation
This commit is contained in:
@@ -49,11 +49,15 @@ class Stundenplan extends FHCAPI_Controller
|
||||
*/
|
||||
public function roomInformation()
|
||||
{
|
||||
|
||||
|
||||
// storing the get parameter in local variables
|
||||
$ort_kurzbz = $this->input->get('ort_kurzbz', TRUE);
|
||||
$start_date = $this->input->get('start_date', TRUE);
|
||||
$end_date = $this->input->get('end_date', TRUE);
|
||||
|
||||
$this->addMeta("test_start_date",$start_date);
|
||||
|
||||
$this->addMeta("ort",$ort_kurzbz);
|
||||
$this->addMeta("start date",$start_date);
|
||||
$this->addMeta("end date",$end_date);
|
||||
@@ -67,11 +71,50 @@ class Stundenplan extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
$result = hasData($result) ? getData($result) : [];
|
||||
|
||||
// set up the log library and configure the library to log to the db
|
||||
$this->load->library('LogLib');
|
||||
$this->loglib->setConfigs(array(
|
||||
'classIndex' => 5,
|
||||
'functionIndex' => 5,
|
||||
'lineIndex' => 4,
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => 'RESTful API'
|
||||
));
|
||||
|
||||
/* foreach($result as $event){
|
||||
$this->loglib->logInfoDB($event->datum,"NEW DATE");
|
||||
} */
|
||||
|
||||
$testStartDate = new DateTime($start_date);
|
||||
$this->loglib->logInfoDB($testStartDate->format('Y-m-d'),"php start date");
|
||||
$testStartDate->modify('+1 day');
|
||||
$this->loglib->logInfoDB($testStartDate->format('Y-m-d'),"php start date plus one day");
|
||||
$testStartDate->modify('+1 day');
|
||||
$this->loglib->logInfoDB($testStartDate->format('Y-m-d'),"php start date plus one day");
|
||||
$testStartDate->modify('+1 day');
|
||||
$this->loglib->logInfoDB($testStartDate->format('Y-m-d'),"php start date plus one day");
|
||||
$testStartDate->modify('+1 day');
|
||||
$this->loglib->logInfoDB($testStartDate->format('Y-m-d'),"php start date plus one day");
|
||||
|
||||
$this->groupTheCalendar($result);
|
||||
//php start date
|
||||
$phpStartDate = new DateTime($start_date);
|
||||
|
||||
//$phpStartDate->modify('+1 day');
|
||||
$this->addMeta('result',$phpStartDate);
|
||||
|
||||
error_log("test".print_r($result,true));
|
||||
|
||||
//echo($this->db->last_query());
|
||||
$this->terminateWithSuccess($result);
|
||||
|
||||
}
|
||||
|
||||
private function groupTheCalendar($data){
|
||||
|
||||
}
|
||||
|
||||
public function Stunden()
|
||||
{
|
||||
$this->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
|
||||
@@ -18,7 +18,7 @@ class Stundenplan_model extends DB_Model
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getRoomDataOnDay($ort_kurzbz='EDV_A2.06',$start_date='2024-05-21',$end_date='2024-05-21'){
|
||||
public function getRoomDataOnDay($ort_kurzbz='EDV_A2.06',$start_date,$end_date){
|
||||
|
||||
|
||||
$this->addSelect(['*',"CONCAT(UPPER(sp.stg_typ),UPPER(sp.stg_kurzbz),'-',COALESCE(CAST(sp.semester AS varchar),'/'),COALESCE(CAST(sp.verband AS varchar),'/')) as stg","lektor","CONCAT(lehrfach,'-',lehrform) as lv_info" ]);
|
||||
|
||||
@@ -17,6 +17,11 @@ const app = Vue.createApp({
|
||||
currentDate: function(){
|
||||
return new Date(this.calendarWeek.y, this.calendarWeek.m, this.calendarWeek.d);
|
||||
},
|
||||
},
|
||||
methods:{
|
||||
calendarDate_to_UTC_date: function(calendarDate){
|
||||
return [calendarDate.y, calendarDate.m, calendarDate.d].join('-');
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -25,6 +30,18 @@ const app = Vue.createApp({
|
||||
this.stunden[std.stunde] = std; // TODO(chris): geht besser
|
||||
});
|
||||
|
||||
|
||||
console.log(this.calendarDate_to_UTC_date(this.calendarWeek.firstDayOfWeek),"this is the converted calendar date")
|
||||
|
||||
/* console.log(this.convertDateToUtcDate(this.calendarWeek.firstDayOfWeek), "iso string here")
|
||||
|
||||
console.log(this.calendarWeek.cdFirstDayOfWeek.y,"this is the year of the first day of the week");
|
||||
console.log(this.calendarWeek.cdFirstDayOfWeek.m,"this is the month of the first day of the week");
|
||||
console.log(this.calendarWeek.cdFirstDayOfWeek.d,"this is the day of the first day of the week");
|
||||
|
||||
console.log(this.calendarWeek.firstDayOfWeek,"this is the first day of the week");
|
||||
console.log(this.convertDateToUtcDate(this.calendarWeek.firstDayOfWeek), "this is the UTC date")
|
||||
*/
|
||||
this.$fhcApi.factory.stundenplan.getRoomInfo('EDV_A6.09', this.calendarWeek.firstDayOfWeek, this.calendarWeek.lastDayOfWeek).then(res =>{
|
||||
let events;
|
||||
if (res.data && res.data.forEach) {
|
||||
|
||||
Reference in New Issue
Block a user