Yes, shortly before WWII. They were still useful at times but they hadn't been a deciding factor in anything since Napoleon. It's not like you can't carry a knife but if you want to fix it to your rifle you're going to have a bad time. Not as bad as the guy engineering a trebuchet would be thoughinfantry never gave up on bayonets did they?
