function for panel data + to date conversion