GithubHelp home page GithubHelp logo

zoltankassai / d8-module-generate-time-and-date-intervals-by-edtf Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 7 KB

Experimental Drupal 8 module for generate time and date intervals for truncated and incomplete times and dates

PHP 100.00%
drupal-8 edtf

d8-module-generate-time-and-date-intervals-by-edtf's Introduction

sample2

Extended time and date format project

Experimental Drupal 8 module for generate time and date intervals for truncated and incomplete times and dates. Useful when we would like to arrange historical events or just if we have a huge amount of old photo :) Non eventual version!

Dates, times

  • '1985-04-12' means 1985 April 12th
  • '1985-04' means 1985 April
  • '1985' means 1985
  • '1985-04-12T23:20:30' means 1985 April 12th at 23:20:30

Sub-year groupings

  • '21' means Spring (independent of location)
  • '22' means Summer (independent of location)
  • '23' means Autumn (independent of location)
  • '24' means Winter (independent of location)
  • '25' means Spring - Northern Hemisphere
  • '26' means Summer - Northern Hemisphere
  • '27' means Autumn - Northern Hemisphere
  • '28' means Winter - Northern Hemisphere
  • '29' means Spring - Southern Hemisphere
  • '30' means Summer - Southern Hemisphere
  • '31' means Autumn - Southern Hemisphere
  • '32' means Winter - Southern Hemisphere
  • '33' means Quarter 1 (3 months in duration)
  • '34' means Quarter 2 (3 months in duration)
  • '35' means Quarter 3 (3 months in duration)
  • '36' means Quarter 4 (3 months in duration)
  • '37' means Quadrimester 1 (4 months in duration)
  • '38' means Quadrimester 2 (4 months in duration)
  • '39' means Quadrimester 3 (4 months in duration)
  • '40' means Semestral 1 (6 months in duration)
  • '41' means Semestral 2 (6 months in duration)
Examples:
  • '2001-21' means Spring, 2001
  • '2001-34' means second quarter of 2001

Qualification of a date
The characters '?', '~' and '%' are used to mean "uncertain", "approximate", and "uncertain" as well as "approximate", respectively. These characters may occur only at the end of the date string and apply to the entire date.

  • '1984?' means year uncertain (possibly the year 1984, but not definitely)
  • '2004-06~' means year-month approximate
  • '2004-06~-11' means year-month approximate
  • '2004?-06-11' means year uncertain
  • '2004-06-11%' means entire date (year-month-day) uncertain and approximate
  • '1984?' means year uncertain (possibly the year 1984, but not definitely)
  • '?2004-06-~11' means year uncertain; month known; day approximate
  • '2004-%06-11' means month uncertain and approximate; year and day known

Unspecified digit(s)
The character 'X' may be used in place of one or more rightmost digits to indicate that the value of that digit is unspecified, for the following cases:

  • ‘201X’ means some year during the 2010s
  • ‘20XX’ means some year during the 2100s
  • ‘2004-XX’ means some month during the 2004
  • ‘1985-04-XX’ means means some day during the April 2004
  • ‘1985-XX-XX’ means some day and month in 1985
  • '156X-12-25' means December 25 sometime during the 1560s
  • '15XX-12-25' means December 25 sometime during the 1500s
  • 'XXXX-12-XX' means some day in December in some year
  • '1XXX-XX' means some month during the 1000s
  • '1XXX-12' means some December during the 1000s
  • '1984-1X' means October, November, or December 1984

Intervals

  • '1964/2008' means beginning sometime in 1964 and ending sometime in 2008
  • '2004-06/2006-08' means beginning sometime in June 2004 and ending sometime in August of 2006
  • '2004-02-01/2005-02-08' means beginning sometime on February 1, 2004 and ending sometime on February 8, 2005
  • '2004-02-01/2005-02' means beginning sometime on February 1, 2004 and ending sometime in February 2005
  • '2004-02-01/2005' means sometime on February 1, 2004 and ending sometime in 2005
  • '1985-04-12/..' means interval starting at 1985 April 12th with day precision; end open
  • '1985-04/..' means interval starting at 1985 April with month precision; end open
  • '1985/..' means interval starting at year 1985 with year precision; end open
  • '../1985-04-12' means interval with open start; ending 1985 April 12th with day precision
  • '../1985-04' means interval with open start; ending 1985 April with month precision
  • '../1985' means interval with open start; ending at year 1985 with year precision
  • '1985-04-12/' means interval starting 1985 April 12th with day precision; end unknown
  • '1985-04/' means interval starting 1985 April with month precision; end unknown
  • '1985/' means interval starting year 1985 with year precision; end unknown
  • '/1985-04-12' means interval with unknown start; ending 1985 April 12th with day precision
  • '/1985-04' means interval with unknown start; ending 1985 April with month precision
  • '/1985' means interval with unknown start; ending year 1985 with year precision
  • '2004-06-~01/2004-06-~20' means an interval in June 2004 beginning approximately the first and ending approximately the 20th
  • '2004-06-XX/2004-07-03' means an interval beginning on an unspecified day in June 2004 and ending July 3.

Set representation

  • Square brackets wrap a single-choice list (select one member).
  • Curly brackets wrap an inclusive list (all members included).
  • Members of the set are separated by commas.
  • No spaces are allowed, anywhere within the expression.
  • Double-dots indicates all the values between the two values it separates, inclusive.
  • Double-dot at the beginning or end of the list means "on or before" or "on or after" respectively.
  • Elements immediately preceeding and/or following as well as the elements represented by a double-dot, all have the same precision. Otherwise, different elements may have different precisions.
Examples:
  • '[1667,1668,1670..1672]' means one of the years 1667, 1668, 1670, 1671, 1672
  • '[..1760-12-03]' means December 3, 1760; or some earlier date
  • '[1760-12..]' means December 1760, or some later month
  • '[1760-01,1760-02,1760-12..] ' means January or February of 1760 or December 1760 or some later month
  • '[1667,1760-12]' means either the year 1667 or the month December of 1760.
  • '[..1984]' means the year 1984 or an earlier year
  • '{1667,1668,1670..1672}' means all of the years 1667, 1668, 1670, 1671, 1672
  • '{1960,1961-12}' means the year 1960 and the month December of 1961.
  • '{..1984}' means the year 1984 and all earlier years

d8-module-generate-time-and-date-intervals-by-edtf's People

Contributors

zoltankassai avatar

Watchers

 avatar  avatar

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.