Comments (3)
I don't think I would use point free style here..
const previousSunday = date => sub('days', get('day', date), date) ;
now you can do
const formatPreviousSunday = compose(format(''YYYY-MM-DD'),previousSunday)
from date-fp.
Ok, thanks for your help! That makes sense... first creating a function that takes and returns a date, so it's easily composable. I practiced some more fp and start to understand the concepts better now. Thanks a lot for this package and the docs, really helped me to get into it!
from date-fp.
@simonhaenisch Happy hacking!
from date-fp.
Related Issues (19)
- Build issues HOT 4
- Strange warning HOT 2
- Timezone Support HOT 1
- Invalid Input To D.format HOT 1
- I18n HOT 4
- Support week numbers in formatting and parsing HOT 8
- timezone-related functions HOT 13
- Support for get('day') HOT 3
- format is not pure HOT 34
- get timezoneOffset test fails HOT 1
- Publish modularized files HOT 2
- Set function always returns 'Invalid date' for 'days', 'months' and 'years' HOT 3
- https://evilcorp.limited/date-fp - Your connection is not secure HOT 3
- Return 0 when get('week') HOT 6
- the purity behind the curtain ... HOT 1
- Add or subtract 'weeks' as a timespan? HOT 2
- Support for ISO 8601 compliant zoned date times HOT 3
- Add TypeScript typings HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from date-fp.