tigercosmos / date2obj

Parse Date to Simple Object in JavaScript
https://www.npmjs.com/package/date2obj
MIT License
27 stars 3 forks source link

Date to JSON? You mean Date to Object. #2

Closed jhuckaby closed 6 years ago

jhuckaby commented 6 years ago

This library has nothing to do with JSON. It outputs an Object, not a JSON string.

If you really want to output JSON, you have to call JSON.stringify() and pass in your object. But really, you may just want to consider renaming this to something like date2object.

tigercosmos commented 6 years ago

It is hard to consider the name. The Date is an object. It is confusing if the name is date2objet. However, I agree, it is not correct to use json, since people would expect string output.

tigercosmos commented 6 years ago

I determine to change the name. Thanks!