Browse Source

Fix "Report Month" being required

Alan Lam 5 years ago
parent
commit
80b870c28f
2 changed files with 3 additions and 2 deletions
  1. 2 1
      engine/project.php
  2. 1 1
      views/project_form.php

+ 2 - 1
engine/project.php

@@ -535,7 +535,8 @@ class Project extends Model {
 		return CarbonImmutable::parse($this->dts_deadline, "UTC");
 	}
 
-	public function getDateTimeReport(): CarbonImmutable {
+	public function getDateTimeReport(): ?CarbonImmutable {
+		if(!$this->dts_report) return null;
 		return CarbonImmutable::parse($this->dts_report, "UTC");
 	}
 

+ 1 - 1
views/project_form.php

@@ -236,7 +236,7 @@ $output_locations = static function(array $locations, bool $selected) use ($loca
 				<div class="row mb-1">
 					<label class="col-sm-4 col-form-label" for="date-report">Report Month</label>
 					<div class="col-sm">
-						<input class="form-control" type="date" name="date_report" id="date-report" value="<?=$date_report?>" required />
+						<input class="form-control" type="date" name="date_report" id="date-report" value="<?=$date_report?>" />
 					</div>
 				</div>
 			</div>