Dart library for parsing relative date and time.

Overview

Dateparser

Dart library for parsing relative date and time.

Examples

  • just now
  • a moment ago
  • tomorrow
  • today
  • yesterday
  • 10 days remaining
  • 2 hours ago
  • 2 months ago
  • 3 hours, 1 minute, and 2 seconds ago
  • in 3 minutes

License

Copyright 2022 Mohamed Haisham

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...

World Time App - World time application made using flutter

World Time App - World time application made using flutter

World Time App Flutter Application to view time in different parts of world. This was my first app built while learning flutter App Screenshots Loadin

Jan 17, 2020

A Flutter widget to set time with spinner instead of material time picker

A Flutter widget to set time with spinner instead of material time picker

flutter_time_picker_spinner Time Picker widget with spinner instead of a material time picker. 12H format 24H format 24H format with second Custom sty

Aug 8, 2022

Time Table application specifically aimed towards students. Share Time-Tables. Suggest Updates.

Time-Table-App Time Table application specifically aimed towards students. Tech stack Project is created by: Flutter: 2.8.1 Dart: 2.15.1 Planned Featu

Oct 7, 2022

Flutter-world-time-practice - World Time Tutorial App For Flutter

Flutter-world-time-practice - World Time Tutorial App For Flutter

world_time Result of Flutter Tutorial for Beginners Navigation: pushNamed, pop r

Feb 7, 2022

World-time - A simple application that tells time from different locations by using worldtime api

World-time - A simple application that tells time from different locations by using worldtime api

world_time A new Flutter project. Getting Started This project is a starting poi

Feb 6, 2022

πŸ‘‰ A light-weight Emoji πŸ“¦ for Flutter and Dart-based applications with all up-to-date emojis πŸ˜„. Made from πŸ’―% β˜• with ❀️!

flutter_emoji πŸ‘‰ A light-weight Emoji πŸ“¦ for Flutter and Dart-based applications with all up-to-date emojis πŸ˜„ . Made from πŸ’― % β˜• with ❀️ ! Inspired f

Nov 4, 2022

A Dart micro-library for asserting at build time.

A micro-library for asserting at build time. It's a common practice to configure a Dart app using const (build-time) values. There are benefits to thi

Oct 14, 2022

Flutter cupertino style date picker.

Flutter cupertino style date picker.

Flutter Cupertino Date Picker [pub packages] | δΈ­ζ–‡θ―΄ζ˜Ž Flutter cupertino date picker. Usage 1. Depend Add this to you package's pubspec.yaml file: depend

Dec 26, 2022
Comments
  • Additional natural forms to consider

    Additional natural forms to consider

    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]
    • enhancing timeframes to have shorthand forms (e.g., "d" for day, "w" for week, "m" for month, "h" for hour, "min" for minute, "s" and "sec" for second, etc.)
    • enhance direction to support "from now" to indicate in the future
    • if possible make the comma in the duration_chain optional (e.g., support things like 2 hours 25 seconds ago instead of hours, 25 seconds ago)
    • enhancing duration_chain to support an alternate form where a time is specified instead of an additional duration, e.g., 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
    enhancement 
    opened by klondikedragon 1
  • Enhance the grammar by expanding support

    Enhance the grammar by expanding support

    This provides a couple of notable changes to the grammar.

    • [x] Add shorthand 'd' for day and 'w' for week.
    • [x] The comma used between duration chains is now optional.
    • [x] Parse just a duration from string (without converting to datetime).
    • [x] Adds support for adding and subtracting duration from datetime.
    • [x] Adds support for duration "from" datetime. Note that datetime parsing (such as 00:00) is still missing.
    opened by m-haisham 0
  • Add support for precise datetime parsing

    Add support for precise datetime parsing

    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.

    opened by m-haisham 0
  • Implement proper exceptions

    Implement proper exceptions

    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.

    enhancement 
    opened by m-haisham 0
Releases(v0.2.0)
  • v0.2.0(Sep 20, 2022)

    Added

    • Added custom exceptions.
    • Added en language tests.
    • Added addition and subtraction grammar.
    • Added shorthand 'd' for day and 'w' for week.
    • Added support for returning double and Duration from parse.
    • Added tryParse which is a nullable alternative to parse.
    • Adds support for duration "from" datetime
      • Note that raw datetime parsing (such as 00:00) is still missing
    • Added ability to map to comma from data.

    Changed

    • Unrecognized tokens now return [TokenType.CT_ERROR].
    • Terminate on error in compiler.
    • Value no longer relies on subclasses.

    Fixes

    • Fixed rechron_dev not matching with library declaration.
    • Fixed dependency linking from rechron to rechron_dev.
    • Removed aliases from grammar file.
    • Removed unused 'and' token.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.1-dev.1(Aug 21, 2022)

Owner
Mensch272
I am a human πŸ€₯
Mensch272
A flutter date time picker inspired by flutter-cupertino-date-picker

Flutter Datetime Picker (Pub) flutter_datetime_picker A flutter date time picker inspired by flutter-cupertino-date-picker you can choose date / time

null 0 Nov 30, 2021
Nepali date picker - Material Style Date Picker with Bikram Sambat(Nepali) Calendar Support

Nepali Date Picker + Calendar Material and Cupertino Styled Date Picker, Date Range Picker and Calendar with Bikram Sambat(Nepali) Support. Nepali Dat

Sarbagya Dhaubanjar 35 Jan 3, 2023
Low-level link (text, URLs, emails) parsing library in Dart

linkify Low-level link (text, URLs, emails) parsing library in Dart. Required Dart >=2.12 (has null-safety support). Flutter library. Pub - API Docs -

Charles C 60 Nov 4, 2022
A library for parsing and encoding IEEE-754 binary floating point numbers.

Dart IEEE754 library This library provides decoding and transforming IEEE754 floating point numbers in binary format, double format, or as exponent an

null 0 Dec 24, 2021
An intuitive Token Parser that includes grammar definition, tokenization, parsing, syntax error and debugging. Implementation based on Lexical Analysis for Dart.

Token Parser An intuitive Token Parser that includes syntax/grammar definition, tokenization and parsing. Implementation based on Lexical Analysis. Re

JUST A SNIPER ツ 2 Dec 15, 2022
A class for parsing strings using a sequence of patterns.

This package exposes a StringScanner type that makes it easy to parse a string using a series of Patterns. For example: import 'dart:math' as math; i

Dart 51 Nov 8, 2022
Fluter-json - App Demonstrating JSON Data Parsing with various flutter widgets

users_list Flutter App to Demonstrate JSON Parsing Getting Started This project is a starting point for a Flutter application. A few resources to get

Khurram Rizvi 5 Jul 10, 2021
Flutter RSS feed parsing - A demo application of flutter which parse RSS XML contents to the flutter application

Flutter RSS feed parsing demo This is demo application of flutter which shows ho

Nyakuri Levite 3 Nov 15, 2022
A Funtioning basic Clock UI APP with extra functionalities such as displaying thecurrent time location being used and checking time for other timezones simultaneosly.

clock_UI A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

Anjola Favour Ayomikun 0 Dec 28, 2021
Simple project that consumes the World Time APi and displays the time for the chosen location.

World Time App Simple project that consumes the World Time APi and displays the time for the chosen location. Web Api WorldTime Technologies Flutter A

Mario Vieria 1 Jan 20, 2022