New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@magmacomputing/tempo-plugin-snap

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@magmacomputing/tempo-plugin-snap

Tempo plugin for rounding and snapping dates to custom minute, hour, or sub-second intervals — ideal for calendar UIs, time-pickers, and telemetry aggregation

latest
Source
npmnpm
Version
1.4.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Tempo Plugin

@magmacomputing/tempo-plugin-snap

npm version npm peer dependency version License TypeScript Ready Documentation

A Community plugin for the Tempo library that provides robust time rounding and snapping functionality (e.g. snapping to the nearest 15-minute or 1-hour block) for calendar and scheduling applications.

👉 View the full documentation on our GitHub Pages

Installation

npm install @magmacomputing/tempo-plugin-snap

Usage

import { Tempo } from '@magmacomputing/tempo';
import { SnapPlugin } from '@magmacomputing/tempo-plugin-snap';

// Pass the plugin to `Tempo.init` to register it into the runtime.
Tempo.init({ 
  extends: [SnapPlugin] 
});

const t = new Tempo('2026-06-01T14:08:00Z');

// Snaps to the nearest 15 minutes by default
const snapped = t.snap();
console.log(snapped.format('{hh}:{mi}')); // "14:15"

// Or explicitly provide units and intervals
const snapHour = t.snap('hh', 1);
const snapSecond = t.snap('ss', 30);

Documentation

For full API reference, advanced configuration, and detailed explanations of the rounding features, please visit the official 📖 Snap Plugin Documentation.

Licensing

This is a Community plugin. It is completely free and open-source for personal and commercial use under the MIT license.

Keywords

tempo

FAQs

Package last updated on 18 Sep 2026

Related posts