Skip to main content

I have table project with fields of “full_date” in format YYYY-MM-DD and “year” in format YYYY.
So what to do when I enter date in field “full_date“, it will automatic field-in data in field “year” in format YYYY ?


To automatically fill the “year” field based on the “full_date” field in PHPRUNNER, you can use a custom event. Here’s a step-by-step guide to achieve this:

  1. Open your project in PHPRUNNER.
  2. Navigate to the Events tab.
  3. Select the appropriate event where you want to add the custom code. For this scenario, you can use the Before record added or Before record updated event.
  4. Add the following custom code to extract the year from the “full_date” and set it to the “year” field:
// Extract the year from the full_date field
$values["year"] = date("Y", strtotime($values["full_date"]));