Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@fluentui/date-time-utilities
Advanced tools
@fluentui/date-time-utilities is a utility library for handling date and time operations, commonly used in conjunction with Fluent UI components. It provides a range of functions for date and time manipulation, formatting, and parsing.
Date Arithmetic
This feature allows you to perform arithmetic operations on dates, such as adding days or months to a given date.
const { addDays, addMonths } = require('@fluentui/date-time-utilities');
const today = new Date();
const nextWeek = addDays(today, 7);
const nextMonth = addMonths(today, 1);
console.log(nextWeek, nextMonth);
Date Formatting
This feature provides functions to format dates into various string representations.
const { formatDate } = require('@fluentui/date-time-utilities');
const today = new Date();
const formattedDate = formatDate(today, 'MM/DD/YYYY');
console.log(formattedDate);
Date Parsing
This feature allows you to parse date strings into JavaScript Date objects based on a specified format.
const { parseDate } = require('@fluentui/date-time-utilities');
const dateString = '2023-10-01';
const parsedDate = parseDate(dateString, 'YYYY-MM-DD');
console.log(parsedDate);
Date Comparison
This feature provides functions to compare two dates, returning whether one is before, after, or the same as the other.
const { compareDates } = require('@fluentui/date-time-utilities');
const date1 = new Date('2023-10-01');
const date2 = new Date('2023-10-02');
const comparisonResult = compareDates(date1, date2);
console.log(comparisonResult);
date-fns is a popular library for date manipulation in JavaScript. It offers a wide range of functions for parsing, formatting, and manipulating dates. Compared to @fluentui/date-time-utilities, date-fns has a larger community and more comprehensive documentation.
Moment.js is a widely-used library for date and time manipulation. It provides extensive functionality for parsing, validating, manipulating, and formatting dates. While Moment.js is more feature-rich, it is also larger in size compared to @fluentui/date-time-utilities.
Luxon is a modern library for working with dates and times in JavaScript. It is built on top of the native JavaScript Date object and provides a more modern API compared to Moment.js. Luxon offers similar functionalities to @fluentui/date-time-utilities but with a focus on modern JavaScript features.
FAQs
Date-time utilities
The npm package @fluentui/date-time-utilities receives a total of 118,013 weekly downloads. As such, @fluentui/date-time-utilities popularity was classified as popular.
We found that @fluentui/date-time-utilities demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.