The chromospheric emission in the cores of the CaII H & K lines of late-type dwarfs is a well known indicator of magnetic activity that decreases with increasing stellar age. I use this indicator to investigate the formation history of nearby G- and early K-type stars with origins at galactocentric distances similar to that of the region where the Sun was born. A parent sample of single main-sequence stars with near-solar metallicity and known magnetic activity levels is built from catalogues of stellar atmospheric parameters and chromospheric activity indices. A kinematical approach uses Gaia astrometric data to differentiate thin disc stars from thick disc stars. Measured distributions of R'_HK_ chromospheric activity indices are compared with Monte Carlo simulations based on an empirical model of chromospheric activity evolution. The thin disc includes a significant fraction of Sun-like stars with intermediate activity levels while most early K- and G-type stars from the thick disc are inactive. The chromospheric activity distribution among nearby Sun-like dwarfs from the thin disc can be explained by a combination of an old (>6-7Gyr) star formation event (or events) and a more recent (<3Gyr) burst of star formation. Such an event is not required to account for the R'_HK_ index distributions of nearby thick disc stars. The distribution of magnetic activity among local G- and early K-type stars with a near-solar metallicity bears the imprint of an important star formation event that occurred ~1.9 to 2.6Gyr ago in the thin disc of the Milky Way.