Is there an open source .NET equivalent to the date.js library?

It's just interesting if anyone knows about the open .Net library, which handles dates like the date.js library , which allows you to do things like the following.

// What date is next thursday?
Date.today().next().thursday();

// Add 3 days to Today
Date.today().add(3).days();

// Is today Friday?
Date.today().is().friday();

// Number fun
(3).days().ago();

// 6 months from now
var n = 6;
n.months().fromNow();

// Set to 8:30 AM on the 15th day of the month
Date.today().set({ day: 15, hour: 8, minute: 30 });

// Convert text into Date
Date.parse('today');
Date.parse('t + 5 d'); // today + 5 days
Date.parse('next thursday');
Date.parse('February 20th 1973');
Date.parse('Thu, 1 July 2004 22:30:00');

I understand that a DateTime object in .Net already supports some of these functions. I'm particularly interested in the last section of code that parses strings intelligently.

+3
source share
1 answer

I think the closest thing you are going to reach date.js in the .NET world is noda-time .

+2
source

Source: https://habr.com/ru/post/1755596/


All Articles