Timestamps for future intervals - node.js

I have to store my user's availability for example (mon-wed, 10 am to 1 pm), and then use this data to query their calendars to check if they are busy/free
So let's say today it's 29 Jan, Saturday. I want to check availability for the upcoming Tuesday. Now I'll have to generate timestamps for the upcoming Tuesday which would be 1643673600 to 1643846400
How do I generate them? I wanted to write some logic but I have failed. I want to consider the user's timezone too. Is there any API service or package that I can use for this purpose?

check "day.js" npm package, that should help you a lot, it has unix timestamps as well as timezones support
more info https://day.js.org/en/

There is a package called "MomentJs".
Here is a link to the main document page
Here is a link to the document for Unix Timestamp
Use this below code if it solves your problem.
moment().add(3, 'days').unix()
console.log(moment().add(3, 'days').unix());
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>

Related

What do the different dates mean in XML returned by IBM Connections 4.0?

The XML returned from direct REST calls to Connections 4.0 returns dates like so, from a File:
<published>2013-08-06T15:00:08.390Z</published>
<updated>2013-08-15T15:30:20.367Z</updated>
<td:created>2013-08-06T15:00:08.390Z</td:created>
<td:modified>2013-08-15T13:16:59.151Z</td:modified>
<td:lastAccessed></td:lastAccessed>
and from a File Comment:
<published>2013-08-08T18:04:44.949Z</published>
<updated>2013-08-08T18:05:39.566Z</updated>
<td:modified xmlns:td="urn:ibm.com/td">2013-08-08T18:05:39.566Z</td:modified>
<td:created xmlns:td="urn:ibm.com/td">2013-08-08T18:04:44.949Z</td:created>
The API documentation is vague about the conditions under which these dates are set:
<td:created> Creation timestamp in Atom format.
<td:modified> The date that the comment was last updated. Timestamp in Atom format.
<updated> The date that the comment was last updated, as defined in the Atom specification.
<published> The date the comment was initially published, as defined in the Atom specification.
Can one assume that <published> == <td:created> and that <updated> == <td:modified>, as the data seems to indicate, or are there circumstances under which these dates would have different values? Does the answer to this question vary by application (Files, Blogs, etc.)?
Edit
<updated> and <published> are Atom-defined properties. The <td:...> ones are IBM's extensions.
Another way to ask my question might be, What descriptions or definitions would I use to explain each of these dates to a user?
Whilst td:created and published are generally identical, with the foremost exception of content created as a draft and later published, applications use td:modified and updated with slightly different semantics. In Wikis for instance updated reflects the time page contents or metadata last changed, while td:modified is only updated when page contents i.e. title or text are updated. I expect the API documentation to clarify these subtle details, if not please post comments and ask for improvements.

JIRA plugin to view previous issue status

I am looking for a JIRA plugin that will show the status of issues at a previous date I give it. So if I tell it Monday of last week, I would like all of the issues that existed at that time with their status at that time. I was wondering if such a plugin existed or if there is another way to go about this. Thanks for reading and for any help you provide.
*Note, I made a excel macro to basically do this but it includes a gigantic mysql query that I would not like not to use if such a plugin already exists.
I don't think that such a plugin exists at all because this would involve issue statistics to show how the issue changed over time.
You can post an feature request with the Atlassian JIRA team to see if this is possible or not. They could also include this feature in a future release or a proprietary plugin if they see that there is enough interest.
http://www.atlassian.com/resources/support

Domino 8.5.3 regression with Date time

We have recently been testing 8.5.3 and have identified a new issue with how date time values are rendered on xpages.
Issue:
Any datetime fields containing just the time value (e.g., 11:00 AM) when shown in an editable field on xpages gets converted to a different value due to TZ.
If the server is in India (GMT + 5.30) it adds 5.5 hrs and shows 11:00 AM as 04:30 PM. Basically, it assumes all times as GMT unless specified.
This new value also gets saved in the document when saved (so it stores it as 04/08/2012 04:30:00 PM ZE5B) as a result corrupting the original value.
This did not use to happen in 8.5.2 or before and has affected several of our apps.
Has anybody seen this before and can suggest a fix or workaround.
Would appreciate any help.
LO67745: XPAGES: CORRECT TIME DOESN'T SHOW ON DATE TIME PICKER
http://www-01.ibm.com/support/docview.wss?uid=swg1LO67745
8.5.3 FP3 has the fix.
Did you check the application properties? You can specify what timezone to use. Server or browser. When you open a PMR post the PMR number here.

In JIRA (Greenhopper) how do you directly access the greenhopper stored data to calculate Velocity?

I'm trying to use SQL, REST or the Jira Api to find out what the velocity of a project is at any current moment in time. Right now I am trying to find the total number of story points assigned/completed for each sprint and version and from this calculate the velocity of the overall project.
The problem is that Greenhopper is an addon to Jira and does not change the Jira database in anyway, so it must store this information about scrum/agile projects elsewhere. Any ideas where this information might be located?
Thank you!
I finally worked it out!
So here is some of the techniques that we use to access data from Jira.
SQL
This SQL statement for example counts all the issues from every point in Jira for each priority.
SELECT
project.ID AS id,
project.pkey,
project.pname AS projectname,
jiraissue.PRIORITY AS priority,
COUNT(*) AS total
FROM jiraissue
LEFT JOIN project ON jiraissue.PROJECT=project.ID
GROUP BY project.ID,jiraissue.PRIORITY
ORDER BY project.id
Also check out... http://confluence.atlassian.com/display/JIRA041/Example+SQL+queries+for+JIRA
REST Api
I have not tried this properly but there is also a set of REST api that you can use to access some of the data from Jira. This documentation is available here: http://docs.atlassian.com/jira/REST/latest/
An example link: https://JIRA_LINK/rest/auth/1/session
Java
Also another useful link for JIRA Java api: http://docs.atlassian.com/software/jira/docs/api/latest/
I use an older version of jira & greenhopper.... but in that version, greenhopper allows you to choose the field you "burndown" by. In my case it's a field (i believe a custom field) called "Likely". So it should be there in the DB/API somewhere. good luck.

Implement Different Expiry Dates on Documents in a Library

I need to be able to set different expiry dates for each document in a document library; some with no expiry date. What is the best approach for this? Information Policy Management or custom code? If custom code, how would I go about it, use a Site Column for the date?
If you have MOSS, using expiration policies sure seems like the way to go. As you probably know, if you don't have a date field in your library that you can go off of (even through some calculation), then you'll probably have to write custom code to determine the date. But, this custom code is used by the expiration policy.
I was eventually able to accomplish this with OOTB (out of the box) functionality. I created a document library and then created a "Custom View" for it. With the custom view, I was able to apply a rule for the expiry date (a column which I added to doc library). In the end it was pretty easy, though not very obvious :-)

Resources