Learning with Posterior Sampling for Revenue Management under Time-varying Demand