Set Directory Date to Latest Image Date Using EXIF Info?

I have a need to get directories to show the same date as the latest photo in the folder. The problem is that I also need to add a few config files to these directories. That of course changes the directory date.

Is there a way to set the directory date to the date of the newest jpg file within it using the EXIF info or the date from only jpg files?

Additional info is that there will be nested directories containing jpgs.

Photos Project1 Set 1 Set 2 Po 1 Project 2 Set 1 Lo 2

Hope someone can help as I have ran out of ideas.

Thanks!