1.0.4 • Published 4 months ago

iso-fns v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

What is iso-fns?

Iso-fns is a date-time library for Javascript based on the Temporal Proposal for JavaScript and inspired by date-fns which represents all date-time primitives as strings formatted according the iso-8601 standard. An instant in time is represented as a string formatted as "YYYY-MM-DDThh:mm:ss.sssZ" and a date (or plain date) is represented as "YYYY-MM-DD". Each function in this library will input some iso 8601 string and perform an operation on it, returning another iso 8601 formatted string.

Why represent temporal types as strings?

A type represented as a javascript class cannot be sent over the wire in a JSON payload without being serialized. Then on the other end of the wire, the payload has to be deserialized into a class again to access the methods. Representing the type as a string avoids this boilerplate, since the type can be sent over the wire directly and performing operations on the type requires no deserialization.

An additional benefit to this approach is the transparency of strings. There can be no internal state, no overwritten methods, or any other difficult-to-follow structure. Strings are the most readable format for date-time information.

Contents

There are 7 fundamental types covered by this library

  • Instant (yyyy-mm-ddThh:mm:ss.mmmZ)
  • DateTime (yyyy-mm-ddThh:mm:ss.mmm | yyyy-mm-ddThh:mm:ss | yyyy-mm-ddThh:mm)
  • Date (yyyy-mm-dd)
  • Time (hh:mm:ss.mmm | hh:mm:ss | hh:mm)
  • YearMonth (yyyy-mm)
  • MonthDay (--mm-dd)
  • Duration (PnYnMnWnDTnHnMnS)

For documentation on the functions included in this library, check out https://iso-fns.org.

Contributors ✨


Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

2.0.0-alpha.17

4 months ago

2.0.0-alpha.16

6 months ago

2.0.0-alpha.15

1 year ago

2.0.0-alpha.14

2 years ago

2.0.0-alpha.7

2 years ago

2.0.0-alpha.8

2 years ago

2.0.0-alpha.9

2 years ago

2.0.0-alpha.11

2 years ago

2.0.0-alpha.3

2 years ago

2.0.0-alpha.10

2 years ago

2.0.0-alpha.4

2 years ago

2.0.0-alpha.5

2 years ago

2.0.0-alpha.6

2 years ago

2.0.0-alpha.0

2 years ago

2.0.0-alpha.1

2 years ago

2.0.0-alpha.2

2 years ago

2.0.0-alpha.13

2 years ago

2.0.0-alpha.12

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.33

3 years ago

0.0.34

3 years ago

0.0.35

3 years ago

0.0.30

3 years ago

0.0.32

3 years ago

0.0.29

3 years ago

0.0.20

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.23

3 years ago

0.0.24

3 years ago

0.0.25

3 years ago

0.0.19

3 years ago

0.0.26

3 years ago

0.0.27

3 years ago

0.0.28

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.9

3 years ago

0.0.16

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago