---
title: "Grafana: time field matching in transformations | VulCode"
description: "In Grafana we fixed matching a field named time in transformations, which caught every time field in the frame. Written in TypeScript with a Jest test."
url: "https://vulcode.com/en/opensource/contributions/grafana"
lang: "en"
---

[All contributions](https://vulcode.com/en/opensource/contributions)

grafana/grafana

# Grafana

An open observability and data visualisation platform that shows metrics, logs and traces from Prometheus, Loki, Elasticsearch, PostgreSQL and many other sources on dashboards.

[See the repository](https://github.com/grafana/grafana) [All contributions](https://vulcode.com/en/opensource/contributions)

- **Language**: TypeScript
- **GitHub stars**: 78,050
- **Merged changes**: 1
- **Project site**: [grafana.com](https://grafana.com)

## What we changed

Matching fields by the name Time or time in transformations now hits only the field with that name, not every time field in the data frame, so Organize fields and Filter by name hide just that one field.

### What this work shows

- Grafana data transformations

- Field matching in data frames

- Unit tests with Jest

What was broken

### Hiding time hid every time field

The Time and time fallback in nameMatcher.ts matched every field of type time. With two time fields, for example a second one made with Add field from calculation and Convert field type, Organize fields and Filter by name hid both instead of only the field named time.

How we fixed it

### The fallback applies only when needed

The fallback now applies only when no field in the frame already has Time or time as its name or display name. A renamed time field still matches as before, and a new test in nameMatcher.test.ts failed before the fix.

[#135263](https://github.com/grafana/grafana/pull/135263)

## Merged change 1

- [#135263 Transformations: Fix field named Time matching all time fields Merged 28 October 2026](https://github.com/grafana/grafana/pull/135263)

## What it taught us

In a large TypeScript monorepo a logic fix must not break a fallback someone relies on: the renamed time field case still works, and a new test shows the difference.

[More about this technology: TypeScript, React and Node](https://vulcode.com/en/technologies/typescript-react-and-node)

## Other projects we write code for

- [**Material UI** JavaScript · 99,391 stars A React component library that implements Google's Material Design: ready-made text fields, selects, buttons and other interface elements.](https://vulcode.com/en/opensource/contributions/material-ui)

- [**Marked** TypeScript · 37,323 stars A fast Markdown parser and compiler to HTML, written in TypeScript and following CommonMark and GitHub Flavored Markdown.](https://vulcode.com/en/opensource/contributions/marked)

- [**Autoprefixer** JavaScript · 22,197 stars A PostCSS plugin that adds browser prefixes to CSS based on Can I Use data, including the -ms-grid syntax for CSS Grid layouts.](https://vulcode.com/en/opensource/contributions/autoprefixer)

- [**Lichess** TypeScript · 19,013 stars The lichess.org chess server: free, ad-free and open source, focused on real-time play. The back end is written in Scala, the interface in TypeScript.](https://vulcode.com/en/opensource/contributions/lichess)

- [**compromise** JavaScript · 12,176 stars A natural language processing library in JavaScript: it splits text into sentences and words, tags parts of speech, conjugates verbs and inflects nouns, and reads dates through a plugin. It runs in the browser and in Node.js.](https://vulcode.com/en/opensource/contributions/compromise)

- [**Pterodactyl** PHP · 9,537 stars A free, open source game server management panel built with PHP, React and Go. Every game server runs in its own isolated Docker container.](https://vulcode.com/en/opensource/contributions/pterodactyl)

## Describe your project.

A free quote comes back within an hour during working hours.

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)
