Jump to content
  • Revista PROGRAMAR: Já está disponível a edição #60 da revista programar. Faz já o download aqui!

GuiSilva

[Resolvido] Ver a que semana pertence o dia da data

Recommended Posts

GuiSilva

Olá, eu necessito de saber o numero da semana de uma certa data, a data é dada por @item.DataInicio

a função deve ser chamada desta forma?

<input type="button" value="Teste" onclick="checkweek('@item.DataInicio')"/>

Share this post


Link to post
Share on other sites
gabrielribeiro

Moment.js pode ser a solução.

http://momentjs.com/docs/#/displaying/

var data = new Date(); // Ou qualquer que seja a sua data
var diaDaSemana = moment(data).format("d");
var semanaDoAno = moment(data).format("w");

Edited by gabrielribeiro
  • Vote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.