Last active
July 5, 2016 17:30
-
-
Save ckoppelman/516dfbb4c7af22f8f980dd6d836031cf to your computer and use it in GitHub Desktop.
Find the "API version" for an arbitrary Salesforce release name and vice versa.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to_version_string=->v{%w{spring summer winter}[v.to_i%3] + ' ' + (2005+(v.to_i-2)/3).to_s} | |
from_version_string=->s{ | |
no_apostrophe = s.sub(?', '20') | |
season, year = no_apostrophe.split(' ') | |
(2+(year.to_i-2005)*3 + %w{wi sp su}.index(season.downcase[0,2])).to_s + '.0' | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment