Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting milliseconds in to Weeks #75

Closed
ankurshah32 opened this issue Feb 19, 2020 · 1 comment
Closed

Converting milliseconds in to Weeks #75

ankurshah32 opened this issue Feb 19, 2020 · 1 comment

Comments

@ankurshah32
Copy link

I am converting milliseconds in to weeks it works fine
d3.timeFormat('%U')(new Date(d.CreationDate * 1000)) provide me an output for a 1 year for eg.
W-01, W-02, .... W-52.
What if we have there are more than one year it again gives me a W-01 and all. How can we detect if W-01 is from this year and another W-01 is from other year?
Can we customize the time format like below
W-01-2019 or W-01-19
W-01-2020 or W-01-20

@Fil
Copy link
Member

Fil commented Feb 19, 2020

I suppose you could use

d3.timeFormat('W-%U-%y')(new Date())

To ask for help, please don't open an issue; use the Stack Overflow tag d3.js instead. Thousands of D3-related questions have been asked there, and some answers may be relevant to you.

When asking for help, please include a link to demonstrate the issue, preferably as an Observable notebook. It is often impossible to debug from code snippets alone. Isolate the issue and reduce your code as much as possible before asking for help. The less code you post, the easier it is for someone to debug, and the more likely you are to get a helpful response.

If you have a question about D3’s behavior and want to discuss it with other users, also consider the d3-js Google Group or joining the d3-js Slack.

Thank you! 🤖

@Fil Fil closed this as completed Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants