How to set Monday as the first day of week

Four Stars

How to set Monday as the first day of week

I have a problem when I would like to get week of year by the following expression:

TalendDate.formatDate("w", date)

For example, If date = 2019-01-06 it will return 2 which I would like it to return 1.

Forteen Stars

Re: How to set Monday as the first day of week

@fararen , you have write expression the below way.

 

TalendDate.formatDate("w", date))-1

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Four Stars

Re: How to set Monday as the first day of week

It's not working for the other day

Forteen Stars

Re: How to set Monday as the first day of week

@fararen ,what is other day? can you give example.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Four Stars

Re: How to set Monday as the first day of week

For 2019-01-07 it will return 1 which should return 2

Forteen Stars

Re: How to set Monday as the first day of week

@fararen ,check the below one is working as expected.

 

Sting date type

TalendDate.getPartOfDate("DAY_OF_WEEK",TalendDate.parseDate("yyyy-MM-dd", "2019-01-06"))

Date data type

TalendDate.getPartOfDate("DAY_OF_WEEK",row3.date)

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Four Stars

Re: How to set Monday as the first day of week

I would like to get week of year not day of week

Forteen Stars

Re: How to set Monday as the first day of week

@fararen ,did you verify the below link,if not please check.

 

https://community.talend.com/t5/Design-and-Development/resolved-How-to-display-week-number/td-p/6258...

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download