If any nonconforming building shall be partially destroyed, it may be restored or repaired, provided that a building permit is obtained within one year after the destruction thereof and work is commenced within 18 months and completed within two years after the destruction thereof.