Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
159 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var addYears = require('date-fns/fp/addYears') | ||
var dateFns = require('date-fns/fp') | ||
var formatWithOptions = dateFns.formatWithOptions | ||
var eoLocale = require('date-fns/locale/eo') | ||
|
||
var addFiveYears = addYears(5) | ||
var dateToString = formatWithOptions({locale: eoLocale}, 'D MMMM YYYY') | ||
|
||
var dates = [ | ||
new Date(2017, 0 /* Jan */, 1), | ||
new Date(2017, 1 /* Feb */, 11), | ||
new Date(2017, 6 /* Jul */, 2) | ||
] | ||
|
||
var formattedDates = dates | ||
.map((date) => dateToString(addFiveYears(date))) | ||
.join(', ') | ||
|
||
console.log(formattedDates === '1 januaro 2022, 11 februaro 2022, 2 julio 2022') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var addYears = require('date-fns/fp/addYears') | ||
var dateFns = require('date-fns/fp') | ||
var formatWithOptions = dateFns.formatWithOptions | ||
var eoLocale = require('date-fns/locale/eo') | ||
|
||
const addFiveYears = addYears(5) | ||
const dateToString = formatWithOptions({locale: eoLocale}, 'D MMMM YYYY') | ||
|
||
const dates : Date[] = [ | ||
new Date(2017, 0 /* Jan */, 1), | ||
new Date(2017, 1 /* Feb */, 11), | ||
new Date(2017, 6 /* Jul */, 2) | ||
] | ||
|
||
const formattedDates : string = dates | ||
.map((date) => dateToString(addFiveYears(date))) | ||
.join(', ') | ||
|
||
console.log(formattedDates === '1 januaro 2022, 11 februaro 2022, 2 julio 2022') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import addYears from 'date-fns/esm/fp/addYears' | ||
import {formatWithOptions} from 'date-fns/esm/fp' | ||
import eoLocale from 'date-fns/esm/locale/eo' | ||
|
||
const addFiveYears = addYears(5) | ||
const dateToString = formatWithOptions({locale: eoLocale}, 'D MMMM YYYY') | ||
|
||
const dates = [ | ||
new Date(2017, 0 /* Jan */, 1), | ||
new Date(2017, 1 /* Feb */, 11), | ||
new Date(2017, 6 /* Jul */, 2) | ||
] | ||
|
||
const formattedDates = dates | ||
.map((date) => dateToString(addFiveYears(date))) | ||
.join(', ') | ||
|
||
console.log(formattedDates === '1 januaro 2022, 11 februaro 2022, 2 julio 2022') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import resolve from 'rollup-plugin-node-resolve' | ||
import commonjs from 'rollup-plugin-commonjs' | ||
|
||
export default { | ||
entry: 'fp.js', | ||
dest: 'dist/fp.js', | ||
format: 'cjs', | ||
plugins: [ | ||
resolve({jsnext: true, main: true}), | ||
commonjs() | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import addYears from 'date-fns/esm/fp/addYears' | ||
import {formatWithOptions} from 'date-fns/esm/fp' | ||
import eoLocale from 'date-fns/esm/locale/eo' | ||
|
||
const addFiveYears = addYears(5) | ||
const dateToString = formatWithOptions({locale: eoLocale}, 'D MMMM YYYY') | ||
|
||
const dates = [ | ||
new Date(2017, 0 /* Jan */, 1), | ||
new Date(2017, 1 /* Feb */, 11), | ||
new Date(2017, 6 /* Jul */, 2) | ||
] | ||
|
||
const formattedDates = dates | ||
.map((date) => dateToString(addFiveYears(date))) | ||
.join(', ') | ||
|
||
console.log(formattedDates === '1 januaro 2022, 11 februaro 2022, 2 julio 2022') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var addYears = require('date-fns/fp/addYears') | ||
var dateFns = require('date-fns/fp') | ||
var formatWithOptions = dateFns.formatWithOptions | ||
var eoLocale = require('date-fns/locale/eo') | ||
|
||
var addFiveYears = addYears(5) | ||
var dateToString = formatWithOptions({locale: eoLocale}, 'D MMMM YYYY') | ||
|
||
var dates = [ | ||
new Date(2017, 0 /* Jan */, 1), | ||
new Date(2017, 1 /* Feb */, 11), | ||
new Date(2017, 6 /* Jul */, 2) | ||
] | ||
|
||
var formattedDates = dates | ||
.map((date) => dateToString(addFiveYears(date))) | ||
.join(', ') | ||
|
||
console.log(formattedDates === '1 januaro 2022, 11 februaro 2022, 2 julio 2022') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import addYears from 'date-fns/esm/fp/addYears' | ||
import {formatWithOptions} from 'date-fns/esm/fp' | ||
import eoLocale from 'date-fns/esm/locale/eo' | ||
|
||
const addFiveYears = addYears(5) | ||
const dateToString = formatWithOptions({locale: eoLocale}, 'D MMMM YYYY') | ||
|
||
const dates = [ | ||
new Date(2017, 0 /* Jan */, 1), | ||
new Date(2017, 1 /* Feb */, 11), | ||
new Date(2017, 6 /* Jul */, 2) | ||
] | ||
|
||
const formattedDates = dates | ||
.map((date) => dateToString(addFiveYears(date))) | ||
.join(', ') | ||
|
||
console.log(formattedDates === '1 januaro 2022, 11 februaro 2022, 2 julio 2022') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters