How can I get week number from date?

Hello @Teodor,

I made a list and it contains a date field. I need to show week number these dates . How can I do client side (app connect) that ?

Hi Serhat,
You can use the moment js framework to do this. Please check Patrick’s example here:

There is no formatter in App Connect for that. Include momentjs on your page and use the following custom formatter.

dmx.Formatters('string', {
  getWeek: function(val) {
    return moment(val).week();
  },

  getIsoWeek: function(val) {
    return moment(val).isoWeek();
  }
});
1 Like