You can learn enough of a language to be dangerous in just a couple weeks. Enough to be productive in 2-3 months. However, there are 3 other things you have to learn:
1. How the code for the project you are hired for works. How it's laid out. All the weird shit about it.
2. How the framework/libraries used by the project works. Nothing to do with the project, but maybe you haven't used Angular, Swing, or Boost before.
3. How the data is laid out, and how it gets in/out of your system. What database tables are there, what's the workflow.
Those 3 things are the hard part and what take 6-12 months. Learning Javascript, Ruby, or whatever language is the least of your worries.