Skip to content

parsedate: Parse and reformat dates and times#74

Closed
tsibley wants to merge 4 commits intomasterfrom
parsedate
Closed

parsedate: Parse and reformat dates and times#74
tsibley wants to merge 4 commits intomasterfrom
parsedate

Conversation

@tsibley
Copy link
Collaborator

@tsibley tsibley commented Feb 25, 2016

Basically a front-end to Time::ParseDate, which offers more control than Date::Manip::DM5's ParseDate(). The fatpack recs, already 7.4MB, is increased only 28KB by Time::ParseDate, so there's no huge loss to avoid it. POSIX, luckily, is part of core.

@tsibley
Copy link
Collaborator Author

tsibley commented Feb 25, 2016

Yay! Travis caught a problem with older Perls I didn't realize would be an issue. I'll fix it up tomorrow.

@tsibley
Copy link
Collaborator Author

tsibley commented Feb 26, 2016

This branch is now good to go. @benbernard, would you take a look?


my $options = {
'key|k=s' => sub { $this->{'KEYS'}->add_groups($_[1]) },
'format|f=s' => \($this->{'FORMAT'}),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hadn't seen this ($hash->{key}) format before, cool!

@benbernard
Copy link
Owner

Looks great! I had a few comments, but feel free to merge as-is

@tsibley
Copy link
Collaborator Author

tsibley commented Feb 28, 2016

Thanks for the notes! I'll make the changes you recommended and merge away.

@tsibley
Copy link
Collaborator Author

tsibley commented Feb 28, 2016

In adding some tests, I just found a bug (timezones, naturally), so I'm going to fix that and repush at some point (probably not today).

@benbernard
Copy link
Owner

awesome, glad you found it!

On Sun, Feb 28, 2016 at 11:53 AM Thomas Sibley notifications@github.com
wrote:

In adding some tests, I just found a bug (timezones, naturally), so I'm
going to fix that and repush at some point (probably not today).


Reply to this email directly or view it on GitHub
#74 (comment)
.

tsibley added 3 commits March 29, 2018 22:58
Naming tests is often very helpful in debugging to ensure you're looking
at the right thing and to more quickly get a sense of what's broken.
Basically a front-end to Time::ParseDate, which offers more control than
Date::Manip::DM5's ParseDate().  The fatpack recs, already 7.4MB, is
increased only 28KB by Time::ParseDate, so there's no huge loss to avoid
it.  POSIX, luckily, is part of core.
benbernard added a commit that referenced this pull request Feb 22, 2026
Fix #71: Unicode/newline handling in totable and toptable
- Use string-width package for proper visual width of CJK chars and emoji
- Escape newlines, tabs, and backslashes in table cell values

Fix #81: Add --only flag to decollate
- New -o/--only option outputs only deaggregated fields, excluding
  original record fields

Fix #59: Add file output to multiplex
- New --output-file-key/-o and --output-file-eval/-O options
- Supports {{key}} interpolation in file paths
- Creates directories automatically

Fix #86: Add fromxls input operation
- Reads xls/xlsx/xlsb/xlsm files using xlsx library
- Supports --sheet, --all-sheets, --no-header, --key/--field options

Implement parsedate operation (closes PR #74)
- TypeScript implementation of the parsedate transform from the old
  Perl PR
- Supports --key, --output, --format, --output-format, --epoch,
  --output-epoch, --timezone options
- Custom strftime-compatible parsing and formatting

Fix #65: Add empty stream tests for collate
- Confirms collate handles empty input without crashing for all
  aggregator types (avg, count, sum, max, min)

Update man pages, operation registry, dispatcher, and test counts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@benbernard
Copy link
Owner

Superseded by TypeScript Implementation

A TypeScript implementation of parsedate has been created in PR #90, covering the functionality proposed here:

  • --key / -k — field to parse
  • --output / -o — custom output field name (defaults to parsed_<key>)
  • --format / -f — strftime-compatible input format
  • --output-format / -F — strftime-compatible output format
  • --epoch / -e — treat input as epoch seconds
  • --output-epoch / -E — output as epoch seconds
  • --timezone / -z — timezone for formatting (IANA timezone names)

This PR can be closed once #90 is merged.

@benbernard benbernard closed this Feb 22, 2026
benbernard added a commit that referenced this pull request Feb 23, 2026
Fix #71: Unicode/newline handling in totable and toptable
- Use string-width package for proper visual width of CJK chars and emoji
- Escape newlines, tabs, and backslashes in table cell values

Fix #81: Add --only flag to decollate
- New -o/--only option outputs only deaggregated fields, excluding
  original record fields

Fix #59: Add file output to multiplex
- New --output-file-key/-o and --output-file-eval/-O options
- Supports {{key}} interpolation in file paths
- Creates directories automatically

Fix #86: Add fromxls input operation
- Reads xls/xlsx/xlsb/xlsm files using xlsx library
- Supports --sheet, --all-sheets, --no-header, --key/--field options

Implement parsedate operation (closes PR #74)
- TypeScript implementation of the parsedate transform from the old
  Perl PR
- Supports --key, --output, --format, --output-format, --epoch,
  --output-epoch, --timezone options
- Custom strftime-compatible parsing and formatting

Fix #65: Add empty stream tests for collate
- Confirms collate handles empty input without crashing for all
  aggregator types (avg, count, sum, max, min)

Update man pages, operation registry, dispatcher, and test counts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants