Socket
Socket
Sign inDemoInstall

fenris-date-tool

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fenris-date-tool

Date utility to make dates suck less when they aren't saved in UTC


Version published
Maintainers
1
Created
Source

fenris-date-tool

Date tool to convert to and from Locale times to UTC

General usage

Currently only works with Danish time.

import { FDTLocaleToUtc } from 'fenris-date-tool';

export const example = (inputDate: string): string => {
  const utcDateString: string = FDTLocaleToUtc(item.DateTime, 'Europe/Copenhagen');
  return utcDateString
};

How to publish

npm run clean
npm run build
npm run build:types
npm publish

How it was build

This is created and maintained with with rollup, typedocs (in theory), @microsoft/api-extractor

How it was build

This is created and maintained with with rollup, typedocs (in theory), @microsoft/api-extractor

start:

npm install --save-dev \
            eslint \
            typescript \
            tslib \
            ts-node \
            rollup \
            @rollup/plugin-commonjs \
            @rollup/plugin-node-resolve \
            @rollup/plugin-typescript
npm install @microsoft/api-extractor

The scripts setup should look like:

  "scripts": {
    "dev": "rollup -c -w",
    "build": "rollup -c --bundleConfigAsCjs",
    "prebuild:types": "rimraf ./build",
    "build:types": "tsc -p ./tsconfig.json --outDir build --declaration true && api-extractor run",
    "predocs": "rimraf ./docs",
    "docs": "typedoc src --out docs",
    "clean": "rimraf ./build ./dist ./docs",
    "test": "echo \"Error: no test specified\" && exit 1"
  },

The rollup config should looklike

import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import pkg from "./package.json";

export default [
  {
    input: "src/index.ts",
    output: [
      { file: pkg.main, format: "cjs" },
      { file: pkg.module, format: "es" },
    ],
    plugins: [
      commonjs(),
      nodeResolve(),
      typescript({ tsconfig: "./tsconfig.json" })],
  },
];

The TSconfig should look like:

{
  "compilerOptions": {
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "esModuleInterop": true,
    "target": "es6",
    "module": "esnext",
    "moduleResolution": "node",
    "strict": true
  }
}

Keywords

FAQs

Package last updated on 17 May 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc