Functions : Can I pass a value from a page parameter to a function ?

Functions : Can I pass a value from a page parameter to a function ?

I have pageparameters that set "startDate" and "endDate"

example :
https://creatorapp.zoho.eu/MYCOMPANY/MYAPP/#Page:Home_Generic?startDate=01-Jan-2021&endDate=31-Dec-2021

I would like to use a series of functions in panels in that same page - can I read these parameters or pass them to a function ? In the function below I want to replace the use of today.subyear with the values being passed via the url.

  1. float panel_calcs.sum_NowYTD_PreviousYear()
  2. {
  3.    sum = carbon[organisation == thisapp.Navigation.getOrganisation() && end_date >= today.subYear(2) && end_date < today.subYear(1)].sum(carbon_emitted);
  4.      if(carbon[organisation == thisapp.Navigation.getOrganisation() && end_date >= today.subYear(2) && end_date < today.subYear(1)].sum(carbon_emitted) == null)
  5.     {
  6.         sum = 0.0;
  7.     }
  8.     else
  9.     {
  10.         sum = carbon[organisation == thisapp.Navigation.getOrganisation() && end_date >= today.subYear(2) && end_date < today.subYear(1)].sum(carbon_emitted);
  11.     }
  12.     return sum.round(2);
  13. }