Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@patternfly/pfe-datetime
Advanced tools
This PFElement enables developers to get a lot of the features from the Intl Object just by using attributes to set the format of the date and time they'd like to display.
<pfe-datetime
datetime="Mon Jan 2 15:04:05 EST 2006"
format="local"
day="numeric"
month="long"
year="numeric">
Mon Jan 2 15:04:05 EST 2006
</pfe-datetime>
<pfe-datetime
datetime="Mon Jan 2 15:04:05 EST 2006"
format="local"
weekday="long"
month="short"
day="2-digit"
year="numeric"
hour="2-digit"
minute="2-digit"
second="2-digit">
Mon Jan 2 15:04:05 EST 2006
</pfe-datetime>
You can use any locale here.
<pfe-datetime
datetime="Mon Jan 2 15:04:05 EST 2006"
format="local"
weekday="long"
month="short"
day="2-digit"
year="numeric"
hour="2-digit"
minute="2-digit"
second="2-digit"
locale="en-GB">
Mon Jan 2 15:04:05 EST 2006
</pfe-datetime>
<pfe-datetime
format="relative"
datetime="Mon Jan 2 15:04:05 EST 2006">
Mon Jan 2 15:04:05 EST 2006
</pfe-datetime>
The value of this should be the same timestamp that you add to the light DOM.
A unix timestamp that will be converted for use in displaying the appropriate date. You would not use both datetime and timestamp, and the last updated will take precedence.
The options for type are:
local
: Shows a formatted time for the indicated locale if providedrelative
: Shows a relative time (1 hour ago, 2 hours until)Possible values: narrow
, short
, long
Possible values: numeric
, 2-digit
, narrow
, short
, long
Possible values: numeric
, 2-digit
Possible values: numeric
, 2-digit
Possible values: numeric
, 2-digit
Possible values: numeric
, 2-digit
Possible values: numeric
, 2-digit
npm run test
npm run build
From the PFElements root directory, run:
npm start
Datetime (and all PFElements) use Prettier to auto-format JS and JSON. The style rules get applied when you commit a change. If you choose to, you can integrate your editor with Prettier to have the style rules applied on every save.
FAQs
Datetime element for PFElements
The npm package @patternfly/pfe-datetime receives a total of 291 weekly downloads. As such, @patternfly/pfe-datetime popularity was classified as not popular.
We found that @patternfly/pfe-datetime demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 16 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.