Skip to content

Conversation

@EduardoRSeifert
Copy link
Member

Description ✍️

This PR adds 2 new functions to parsec, weekday and current_time.

weekday()

weekday will calculate the weekday based on a date or datetime, and will return an integer if no locale is passed or a string with the translated weekday name if a locale is passed

current_time()

current_time will return the current_time in gmt. If the (optional) integer argument is passed, it'll return the current_time considering the argument as an offset.

Examples

'weekday("2024-12-05")' will return 4, and 'weekday("2021-03-21", "pt-BR")' will return 'Quinta-Feira'

At the time of writing:
current_time() will return 19:09:13 and current_time(-3) 16:09:13 (GMT -3 is brasil time)

Overview 🔍

Overview of the feature if possible (screenshot, gif, etc)

Checks ☑️

  • Example

Copy link

@victorpinheirodev victorpinheirodev left a comment

Choose a reason for hiding this comment

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

I have few questions:

  1. What ticket this task belongs to? The PR description and title must contain this information.
  2. How do I smoke this PR?

@EduardoRSeifert
Copy link
Member Author

@victorpinheirodev i'm unsure if there ever was a ticket. As you can see. It's from more than one year ago.
As for smoking, you can just build the gem locally and use the created functions, or point one of your repos that use this gem to this branch and use it there. I would do number 1 if i were you

Copy link

@victorpinheirodev victorpinheirodev left a comment

Choose a reason for hiding this comment

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

Review

Smoking Test 🚭

Image Image

Copy link

@saburabrina saburabrina left a comment

Choose a reason for hiding this comment

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

Smoke Test Approved ✅

weekday()

image

current_time()

image

@tiagogoncalves tiagogoncalves merged commit eb3dd43 into oxeanbits:master Dec 19, 2025
7 checks passed
@EduardoRSeifert EduardoRSeifert deleted the digit-884_add_weekday_and_current_time branch December 20, 2025 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants