Coder Social home page Coder Social logo

voltrue2 / node-datetime Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 5.0 46 KB

An extended Date object for javascript. It handles offsets by days and hours and formatting etc.

License: Other

Shell 6.56% Makefile 0.74% JavaScript 92.02% Smarty 0.68%
datetime javascript timestamp

node-datetime's People

Contributors

danielhiversen avatar voltrue2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

node-datetime's Issues

Date format issue

Hi,
I would like place my datetime format like that : 3rd of August 2018 09:50:34 AM (GMT time)
it's possible ?

defaultFormat lost in dates produced by getDatesInRange; range in reverse order

Hello.

I'm trying to use node-datetime package, and I figured out, that format property is not inherited by objects produced by datetime.getDatesInRange() method.

Example:
const defaultFormat = 'Y-m-d';
const datetime = require('node-datetime');
datetime.setDefaultFormat( defaultFormat );
let start = '2018-09-01', finish = '2018-09-19';

// 1 - both elements has _defaultFormat property set to defaultFormat
var boundaries = [datetime.create( start, defaultFormat ), datetime.create( finish, defaultFormat )];

// 2. using getDatesInRange() -
let range = dstart.getDatesInRange( dfinish );

// 3. In range, all objects has null as _defaultFormat.

Is this behaviour by design?

Question 2:
dstart.getDatesInRange( dfinish ) throws an exception if start > finish.

I need dates in reverse order for my task. Why not to allow producing of a range in that case? It seems that code in DateTime.prototype.getDatesInRange() can handle reverse direction.

WBR, Alexey

wrong calculation of period

function getPeriod(d) {
var hours = d.getHours();
if (hours <= 12) {
return PERIOD.AM;
}
return PERIOD.PM;
}``

you must change the condition

Date Formatting Issue

I am doing the formatting with node date-time. But it is showing wrong only 12:00 pm, It's always showing 00:00 AM.
Example:
time = dateTime.create('2018-07-19 12:54:55');
Ftime = time.format('I:M p');
It's Showing 00:54 AM

Please help me with this. It's very urgent.

Thanks

February Spelling in incorrect

As I notice When I used f For Get Full Name Of Month in that i fond one issue it is Selling is wrong for February. Can You please change it

Thank you

Time in Seconds and Milliseconds did not change

I am using this module in my Node project and used the:

var datetime = require('node-datetime');
var dt = datetime.create();
var cid = dt.now();

To generate time in milliseconds. I console.log the output and refresh my page the time does not change, except i stop it and run it again.

Solution pls

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.