Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement DAY function #1003

Merged
merged 4 commits into from
Aug 21, 2021
Merged

Implement DAY function #1003

merged 4 commits into from
Aug 21, 2021

Conversation

stanim
Copy link
Contributor

@stanim stanim commented Aug 19, 2021

PR Details

Description

Returns the day of a date, represented by a serial number. The day is given as an integer ranging from 1 to 31.
https://support.microsoft.com/en-us/office/day-function-8a7d1cbb-6c7d-4ba1-8aea-25c134d03101

Syntax

DAY(serial_number)

The DAY function syntax has the following arguments:

  • Serial_number Required. The date of the day you are trying to find. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text.

Related Issue

Fixes #1002

Motivation and Context

This helps with Excels from third party, where the DAY function is frequently used.

How Has This Been Tested

Added tests to calc_test.go

Tested on:

  • OS: Archlinux 5.13.10-arch1-1
  • WPS Spreadsheets (version wps-office 11.1.0.10702-1)
  • LibreCalc (version libreoffice-fresh 7.1.5-2)

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

This was referenced Aug 19, 2021
@codecov-commenter
Copy link

codecov-commenter commented Aug 19, 2021

Codecov Report

Merging #1003 (fd47cc3) into master (dca03c6) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1003      +/-   ##
==========================================
+ Coverage   97.52%   97.55%   +0.03%     
==========================================
  Files          29       29              
  Lines       11222    11388     +166     
==========================================
+ Hits        10944    11110     +166     
  Misses        154      154              
  Partials      124      124              
Flag Coverage Δ
unittests 97.55% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
calc.go 98.01% <100.00%> (+0.07%) ⬆️
date.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dca03c6...fd47cc3. Read the comment docs.

@xuri xuri added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 20, 2021
@xuri xuri merged commit 935af2e into qax-os:master Aug 21, 2021
@xuri
Copy link
Member

xuri commented Aug 21, 2021

Thanks for your PR, I have added date-time string parse support base on your branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement DAY function
3 participants