Comments (3)
this is an additive change and would require bumping the minor revision number.
from opentok-node.
Here is what the change looks like, explicitly:
Before (and continues to work):
token = session.generateToken({
expireTime : (new Date().getTime() / 1000)+(7 * 24 * 60 * 60) // in one week
});
After:
token = session.generateToken({
expireTime : daysFromToday(7)
});
function daysFromToday(numDays) {
var today = new Date();
return today.setDate(today.getDate() + numDays);
}
While the number of lines in the after example is greater, the hypothesis here is that Date
is better understood by JS developers than UNIX timestamps. Also, there are common libraries like moment that help JS developers juggle Dates and could be reused here.
from opentok-node.
I'm going to 👎 this proposal now. While unix timestamps are less common than Date objects, I think the latter isn't really the answer. The npm ecosystem has better reusable answers for this: modules. Here is one: https://github.com/pryv/unix-timestamp-js
from opentok-node.
Related Issues (20)
- OpenTok startArchive/stopArchive on the FE side HOT 1
- Error: The token does not match the session ID. reporting randomly HOT 1
- Does not support IPv6
- OT_XDOMAIN_OR_PARSING_ERROR HOT 1
- streamMode is missing in archive options HOT 2
- Patch Archive checks for wrong http response code
- body-parser-1.12.4.tgz: 5 vulnerabilities (highest severity is: 7.5) reachable - autoclosed HOT 1
- express-3.21.2.tgz: 13 vulnerabilities (highest severity is: 9.8) reachable
- ejs-2.7.4.tgz: 3 vulnerabilities (highest severity is: 9.8) unreachable
- request-2.88.2.tgz: 2 vulnerabilities (highest severity is: 9.8) unreachable HOT 3
- express-4.12.4.tgz: 4 vulnerabilities (highest severity is: 7.5) unreachable
- Option to mute microphone of the publisher through a button HOT 1
- bug: error 400 (bad request) using NodeJS SDK method `unregisterCallback` HOT 1
- jsonwebtoken-8.2.0.tgz: 4 vulnerabilities (highest severity is: 9.8) - autoclosed HOT 1
- opentok-2.15.1.tgz: 3 vulnerabilities (highest severity is: 8.1) - autoclosed HOT 1
- Problem with initializing OpenTok HOT 1
- Unable to set the archiving resolution when using automatic session archive
- 2.17.0 breaks due to SyntaxError, automatic json parsing in needle HOT 2
- Session not found error when manual archive startArchive right after createSession with valid session id. HOT 1
- listStreams: TypeError: Cannot read properties of undefined (reading 'map') HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opentok-node.