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

Respect SOURCE_DATE_EPOCH spec #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/ckbuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ this.CKBuilder = ( function() {
} catch ( e ) {
isMinified = false;
}
var now = new Date();
if(System.env.get('SOURCE_DATE_EPOCH') !== null) {
var now = new Date(parseInt(System.getenv("SOURCE_DATE_EPOCH"), 10) * 1000);
} else {
var now = new Date();
}
var timestamp = Integer.toString( now.getUTCFullYear() % 1000, 36 ) + Integer.toString( now.getUTCMonth(), 36 ) + Integer.toString( now.getUTCDate(), 36 ) + Integer.toString( now.getUTCHours(), 36 );
timestamp = timestamp.toUpperCase();

Expand Down
8 changes: 6 additions & 2 deletions src/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@
* @static
*/
copyright: function( eol ) {
var copyright,
date = new Date();
var copyright;
if(System.env.get('SOURCE_DATE_EPOCH') !== null) {
var date = new Date(parseInt(System.getenv("SOURCE_DATE_EPOCH"), 10) * 1000);
} else {
var date = new Date();
}

if ( CKBuilder.options.commercial )
copyright = "/*" + eol + "This software is covered by CKEditor Commercial License. Usage without proper license is prohibited." + eol + "Copyright (c) 2003-" + date.getFullYear() + ", CKSource - Frederico Knabben. All rights reserved." + eol + "*/" + eol;
Expand Down