Our current used car selection

Error
TypeError: C:\virtualShowrooms\nodes_projects\Stocklist framework\views\218\stocklist.ejs:148
   146|         <input type="hidden" name="reg" value="<%= r.Registration %>">
   147|         <input type="hidden" name="mileage" value="<%= r.Mileage %>">
>> 148|         <input type="hidden" name="rDate" value="<%= atDate(r.DateOfRegistration) %>">
   149|       </div>
   150|       <% if (r.Finance_quotes != null && r.Finance_quotes.length > 0){%>
   151|       <div class="vehicle_title finance">

Cannot read properties of undefined (reading 'split')
   at atDate (eval at compile (C:\virtualShowrooms\nodes_projects\node_modules\ejs\lib\ejs.js:673:12), <anonymous>:87:15)
   at eval (eval at compile (C:\virtualShowrooms\nodes_projects\node_modules\ejs\lib\ejs.js:673:12), <anonymous>:168:26)
   at stocklist (C:\virtualShowrooms\nodes_projects\node_modules\ejs\lib\ejs.js:703:17)
   at tryHandleCache (C:\virtualShowrooms\nodes_projects\node_modules\ejs\lib\ejs.js:274:36)
   at exports.renderFile [as engine] (C:\virtualShowrooms\nodes_projects\node_modules\ejs\lib\ejs.js:491:10)
   at View.render (C:\virtualShowrooms\nodes_projects\node_modules\express\lib\view.js:135:8)
   at tryRender (C:\virtualShowrooms\nodes_projects\node_modules\express\lib\application.js:657:10)
   at Function.render (C:\virtualShowrooms\nodes_projects\node_modules\express\lib\application.js:609:3)
   at ServerResponse.render (C:\virtualShowrooms\nodes_projects\node_modules\express\lib\response.js:1039:7)
   at stocklistView (C:\virtualShowrooms\nodes_projects\Stocklist framework\controllers\stocklistController.js:191:25)