@tomashubelbauer/globe
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Globe

Provides localization services for Electron and the browser. Respects the OS date and time format configuration.

Usage

import { TimeStringFormat, DateTimeFormatOptions, DateTimeFormatter } from 'globe';

const dateTimeFormatter = new DateTimeFormatter(
  this.locale,
  this.isSupportedOsPlatform,
  this.osLocaleInfo,
  this.i18nextWrapper.osPlatform,
  this.osDateTimeLocale
);

/**
 * Localize the date/time
 * @param date The date/time to localize
 * @param format The format to be used for the localization
 * @returns The localized date/time string
 */
function formatDateTime(date: number | Date, format: DateTimeFormatOptions) {
  return dateTimeFormatter.formatDateTime(date, format);
}

Build

npm install
npm run build

Release

GitHub Releases are made manually at the moment.

Test

Build the package first: npm run build.

npm test

Roadmap

  • Set up Jest to run with TypeScript and TSDX and in watch mode
  • Set up automated GitHub and NPM releases
  • Add more docs, especially around formatting based on OS date time settings
  • Set up Azure Pipelines CI

Contributing

Contributions are welcome (see the CONTRIBUTING file), though please keep in mind the work-in-progress proof-of-concept state. Might make sense to just observe/discuss until the thing gets stable and well-documented.

License

This project is licensed under the MIT License, see the LICENSE file for details.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.00latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.00

Package Sidebar

Install

npm i @tomashubelbauer/globe

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

157 kB

Total Files

15

Last publish

Collaborators

  • tomashubelbauer