m-haisham / rechron Goto Github PK
View Code? Open in Web Editor NEWDart library for parsing relative date and time.
Home Page: https://pub.dev/packages/rechron
License: BSD 3-Clause "New" or "Revised" License
Dart library for parsing relative date and time.
Home Page: https://pub.dev/packages/rechron
License: BSD 3-Clause "New" or "Revised" License
The project currently raises raw Exception
objects. This is considered bad practice and makes it hard to capture just those raised by the library.
We should create a base exception that will be used for this library.
Expose a new tryParse
method that will return null if failed to parse the relative string.
This is a well-needed client-side alternative to something like https://github.com/tj/go-naturaldate -- nicely done and thank you!
Here are a few additional forms to consider:
last [week|month|quarter|year]
/ next [week|month|quarter|year]
2 hours 25 seconds ago
instead of hours, 25 seconds ago
)7 days ago at 12:35pm
or tomorrow at 7:05:35
Also, consider enhancing the grammar expression to support adding or subtracting another relative period, e.g., something like:
expression => relative (("+"|"-") duration_chain)?
This would enable expressions like:
now-4d
7 days ago + 12 hours, 25 minutes
The parse currently only understands relative datetimes. The previous update (#5) added support for adding and subtracting duration from DateTime using +
and '-' respectively. This currently lacks support for parsing precise DateTime strings such as 18:20:30
.
This should add support for parsing the following strings.
12:00
12:30:00
a hour from 00:00
12 minutes 5 seconds + 12:00
This issue is derived from #4.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.